Hisham Muhammad, creator of htop, writes about programming languages, tools, and software design.
HN links it mainly for htop, which commenters strongly recommend over ps and top; he also discusses his domain name and URL display.
The first tool that came to mind for me was htop [0] with ncurses. It's a friendly alternative to top.
I've previously used ncmpcpp [1] without any major complaints, although it's been a few years since then. It's an mpd [2] client written with ncurses.
On my personal servers I use goaccess [3] to analyze access logs. I remember being able to pick it up pretty quickly on my first try.
Only tangentially related, but you may find it useful to read the "Utility Conventions" [4] entry of The Open Group Base Specifications. I'd also suggest reading through the relevant entries under the "Program Behavior for All Programs" [5] section of GNU Coding Standards [6]. By following existing conventions (or even being aware they exist) you can sometimes make it easier for others to learn how to use your tool.
If you know JavaScript, you may consider writing your program with node. The blessed [7] library is a JavaScript reimplementation of ncurses, and there's even a react renderer [8]. This makes building the UI much easier than many of the alternatives I know. When you're ready to release, you can generate an executable [9] for easy deployment or publication. The biggest benefits of taking this approach are that it makes it very easy to achieve cross-platform support, and the barrier of entry is lower than many alternatives. The biggest caveats are that it'll be slower and much larger than if it had been written with C.
[0] http://hisham.hm/htop/
[1]…
This is a great post, recently I have been trying to re-learn and understand linux (specifically) ubuntu using monitoring tools.
In my opinion htop and Facebook osquery are the two best available tools for understanding how an operating systems and processes work. The osquery approach of recording all OS data in form relational tables (with PIDs as keys etc.) is very useful.
https://hisham.hm/htop/
https://osquery.io/
The osquery query packs are especially useful: https://osquery.io/docs/packs/
Here is an incomplete draft about a similar post:
https://github.com/AKSHAYUBHAT/TopDownGuideToLinux
I think emacs is a good example of a terminal program (not really command line) that made a good success out of becoming more gui and I think it shows a lot of the limitations of the terminal emulators. In a gui you easily get all the colours and not many weird duplicate keyboard shortcuts (exceptions are eg TAB vs C-i and M- vs ESC). You can have images and clicking and middle click paste and multiple fonts and some OS integration. But the interface still remains a fundamentally mutable text-based thing.
For something completely different: https://hisham.hm/userland/
daily-ish drivers of mine:
- autossh - https://linux.die.net/man/1/autossh
- sshfs - https://github.com/libfuse/sshfs
- pandoc - https://pandoc.org/installing.html
- exiftool - https://www.sno.phy.queensu.ca/~phil/exiftool/
- htop - https://hisham.hm/htop/
- tmux - https://github.com/tmux/tmux/wiki
- rsync - https://rsync.samba.org/
- midnight commander - https://midnight-commander.org/ (faster, than loop ing ls, cd .., ls)
Still trying to think about the others.
That EWD is one if my pet peeves. Dijkstra makes an unfair comparison because he lists plenty of examples where 0-based indexing is more convenient but ignores the equally numerous situations where 1-based is more convenient. For example, iterating backwards over an array is much better in an 1-based world.
I like the argument that 1-based is better for indexing and 0-based is better for offsets:
https://hisham.hm/2021/01/18/again-on-0-based-vs-1-based-indexing/
These are thrid-party programs that are unlikely to be installed on a Linux system by default:
http://guichaz.free.fr/iotop/
https://01.org/powertop/
https://github.com/raboof/nethogs
https://github.com/tmux/tmux/wiki
http://mama.indstate.edu/users/ice/tree/
http://hisham.hm/htop/
http://invisible-island.net/dialog/dialog.html
Also, you should prefer "pgrep" to "pidof"; the former is available also on BSDs.