Display the tree of all instance of a particular process

pgrep 'sleep' | while read pid; do pstree -sa -H$pid $pid ; done

1
By: earthdan
2014-04-29 08:47:32

These Might Interest You

  • whowatch is a interactive, ncurses-based, process and users monitoring tool, which updates information in real time. This is a perfect tool for local and remote servers. It displays information about the users currently logged on to the machine, in real-time. Besides standard information (login name, tty, host, user's process), the type of the connection (ie. telnet or ssh) is shown. Display of users command line can be switch to tty idle time. Certain user can be selected and his processes tree may be viewed as well as tree of all system processes. Tree may be displayed with additional column that shows owner of each process. In the process tree mode SIGINT and SIGKILL signals can be sent to the selected process. Killing processes is just as simple and fun as deleting lines on the screen.


    4
    whowatch
    cryptema · 2011-06-30 22:45:39 1
  • display beautiful tree ... "tree dir" display tree from "dir". Show Sample Output


    -2
    tree
    fhh · 2013-09-17 19:15:52 1
  • Usage : tt [OCCURRENCE] tt will display a tree from your actual path tt .svn will display only line containing .svn Show Sample Output


    2
    tt(){tree -pFCfa . | grep "$1" | less -RgIKNs -P "H >>> "}
    strzel_a · 2010-10-12 10:53:33 2
  • By 'pst' you can print out process tree with all details about all processes (including a command line, PID, and the current process you are running in). By 'pst username' you can get an information about processes belonging to the particular user 'username'. Show Sample Output


    0
    alias pst='pstree -Alpha'
    Alexander · 2009-03-20 10:53:37 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: