pstree: Simple yet effective

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.

2013-01-12-solo-2150-pstree-01

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 (-c).

2013-01-12-solo-2150-pstree-02

And probably useful only to me: Adding the -a switch shows the command line arguments for each entry. Occasionally, that’s important.

2013-01-12-solo-2150-pstree-03

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.

4 thoughts on “pstree: Simple yet effective

  1. imgx64

    I see you have systemd as your init (Arch Linux, I guess?). Do you have any opinions on it and its accompanying tools (systemctl, journalctl, etc)?

    1. K.Mandla Post author

      I have no complaints. The old system was slow and cumbersome. systemd starts faster for me and shuts down quicker than anything I’ve ever seen.

      I know there are some complaints (mostly about Unix tradition, if I remember right) but I am pleased with it. 🙂

  2. Pingback: colorwrapper: Quite obviously, the author had me in mind | Inconsolation

  3. Pingback: tree: Two and a half years later. … | Inconsolation

Comments are closed.