Wednesday, December 10, 2014

Adding ppid to ps aux

The usual way BSD style ps command is used does not return the parent process id (ppid). To add it you need to use the "o" option as follows:
ps aux|head -1
# Returns: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
ps axo user,pid,ppid,pcpu,pmem,vsz,rss,tname,stat,start,time,args|head -1
# Returns: USER PID PPID %CPU %MEM VSZ RSS TTY STAT STARTED TIME COMMAND

No comments:

Followers