paperlined.org
rosetta_stone > os
document updated 1 year, 3 months ago, on Dec 2, 2022

ways to do pstree

Linux

ps auxf

pstree -alp

pstree -lpu (-u shows usernames, in parentheses, only on UID transitions; however, the command-line args aren't shown, unfortunately username and the command-line can't both be shown at the same time)

ps -ejH

Solaris

ptree

HPUX

ptree

pstree — for only one user

Linux

ps ufU $USER

pstree -alp $USER

Solaris

ptree -a $USER

ptree -a $USER | perl -nae 'printf "%-8s %s", (getpwuid((stat "/proc/$F[0]")[4]))[0], $_'

AIX

ps -fT1 | less -p $USER

ps -fT1 | perl -nle 'BEGIN{$user=shift} s/(?=.{'$COLUMNS'}).*//; $cur = /^ *$user/; print if $cur; print "\n" if $last && !$cur; $last=$cur' $USER