Some of the simplest tools — the tools we all probably take for granted — are sometimes the most interesting.
If you’re like 95 percent of Linux users, you’ve probably seen pstree. It’s a given that at some point in your Linux education, someone showed you what it does. It’s bundled in psmisc in most distros.
By default, it does a decent job.
But pstree’s switches are simple, and effective. For example, here’s the
-h to highlight the current process, plus the cue to avoid compressing identical subtrees (
And probably useful only to me: Adding the
-a switch shows the command line arguments for each entry. Occasionally, that’s important.
Look for switches that trigger ascii trees, UTF-8 characters sets and process group IDs. It can also display and sort PIDs, among other things. Take a closer look.