PS(1) General Commands Manual PS(1) ps - ps [option ...] ps top This version of ps accepts several kinds of options. o Unix options, which may be grouped and must be preceded by a dash. o BSD o GNU "--" ps ps ps ID (euid=EUID) ID (pid=PID) (tname=TTY)[DD-]hh:mm:ss CPU (time=TIME) (ucmd=CMD) BSD (stat=STAT) (args=COMMAND) PS_FORMAT BSD (TTY) "" -M Z ps -e ps -ef ps -eF ps -ely BSD ps ax ps axu ps -ejH ps axjf ps -eLf ps axms ps -eo euser,ruser,suser,fuser,f,comm,label ps axZ ps -eM root ID ps -U root -u root u ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm ps -Ao pid,tt,user,fname,tmout,f,wchan syslogd ID ps -C syslogd -o pid= PID 42 ps -q 42 -o comm= a BSD "" BSD "-" ps BSD ps (tty) x -A -e -a getsid(2) -d --deselect -N -e -A g a sunos4 -N --deselect T t r x BSD " tty" BSD "-" ps BSD ps ps EUID a ps -p "1 2" -p 3,4 123 --pid 123 +123 --sid 123 -123 ID (PGID) -C procps 15 15 -G ID (RGID) ID ID getgid(2) -g ps ID -s --group --Group ID (RGID) -G --group ID (EGID) ID ID getegid(2)-g --group p pid ID -p --pid -p pid PID ID pid p --pid --pid pid ID -p p --ppid pid ID ID pid pid q pid ID -q --quick-pid -q pid PID ID pid ps pid pid pid q --quick-pid --quick-pid pid ID -q q -s ID ID --sid ID -s t tty tty -t --tty tty ps T tty t -t tty tty tty tty/dev/ttyS1ttyS1S1 "-" --tty tty -t t U ID (EUID) ID ID geteuid(2) -u --user -U ID (RUID) ID ID getuid(2) -u ID (EUID) ID ID geteuid(2) U --user --User ID (RUID) -U --user ID (EUID) -u U ps -c -l --context SELinux -f Do full-format listing. This option can be combined with many other Unix-style options to add additional columns. It also causes the command arguments to be printed. When used with -L, the NLWP (number of threads) and LWP (thread ID) columns will be added. See the c option, the format keyword args, and the format keyword comm. -F -f -F --format -o o j BSD -j l BSD -l -y -M Z SELinux O is preloaded o (overloaded). The BSD O option can act like -O (user-defined output format with some common fields predefined) or can be used to specify sort order. Heuristics are used to determine the behavior of this option. To ensure that the desired behavior is obtained (sorting or formatting), specify the option in some other way (e.g., with -O or --sort). When used as a formatting option, it is identical to -O, with the BSD personality. -O -o -o pid, ,state,tname,time,command -o pid,,tname,time,cmd -o o -o --format -o User-defined format. format is a single argument in the form of a blank-separated or comma-separated list, which offers a way to specify individual output columns. The recognized keywords are described in the STANDARD FORMAT SPECIFIERS section below. Headers may be renamed (ps -o pid,ruser=RealUser -o comm=Command) as desired. If all column headers are empty (ps -o pid= -o comm=) then the header line will not be output. Column width will increase as needed for wide headers; this may be used to widen up columns such as WCHAN (ps -o pid,wchan=WIDE- WCHAN-COLUMN -o comm). Explicit width control (ps opid, wchan:42,cmd) is offered too. The behavior of ps -o pid=X, comm=Y varies with personality; output may be one column named "X,comm=Y" or two columns named "X" and "Y". Use multiple -o options when in doubt. Use the PS_FORMAT environment variable to specify a default as desired; DefSysV and DefBSD are macros that may be used to choose the default Unix or BSD columns. -P psr s u v X -y rss addr -l Z -M SELinux c argv args comm -f BSD -f args comm --cols n --columns n --cumulative -D Set the date format of the lstart field to format. This format is parsed by strftime(3) and should be a maximum of 24 characters to not mis-align columns. --date-format -D e f ASCII --forest ASCII h BSD h BSD ps Linux ps ps Linux BSD --headers --no-headers -H --headers k Specify sorting order. Sorting syntax is [+|-]key.RB [,[ + | - ].IR key [,...]]. Choose a multi-letter key from the STANDARD FORMAT SPECIFIERS section. The "+" is optional since default direction is increasing numerical or lexicographic order. Identical to --sort. ps jaxkuid,-ppid,+pid ps axk comm o comm,args ps kstart_time -ef --lines n n WCHAN USER UID GID --no-headers --no-heading O Sorting order (overloaded). The BSD O option can act like -O (user-defined output format with some common fields predefined) or can be used to specify sort order. Heuristics are used to determine the behavior of this option. To ensure that the desired behavior is obtained (sorting or formatting), specify the option in some other way (e.g., with -O or --sort). For sorting, obsolete BSD O option syntax is O[+|-]k1[,[+|-]k2[,...]]. It orders the processes listing according to the multilevel sort specified by the sequence of one-letter short keys k1,k2, ..." described in the OBSOLETE SORT KEYS section below. The "+" is currently optional, merely re-iterating the default direction on a key, but may help to distinguish an O sort from an O format. The "-" reverses direction only on the key it precedes. --rows n S CPU fork --sort Specify sorting order. Sorting syntax is [+|-]key[,[+|-]key[,...]]. Choose a multi-letter key from the STANDARD FORMAT SPECIFIERS section. The "+" is optional since default direction is increasing numerical or lexicographic order. Identical to k. For example: ps jax --sort=uid,-ppid, +pid --signames "+" "-" w -w --width n H -L LWP NLWP m -m -T SPID --help simplelistoutputthreadsmisc all s|l|o|t|m|a --info L V procps-ng -V procps-ng --version procps-ng ps /proc ps setuid kmem ps CPU ps CPU 100% SIZE RSS struct thread_info struct task_struct 20 KiB SIZE ++ "" init(8) -o -O Commands options such as ps -aux are not recommended as it is a confusion of two different standards. According to the POSIX and Unix standards, the above command asks to display all processes with a TTY (generally the commands users are running) plus all processes owned by a user named x. If that user doesn't exist, then ps will assume you really meant "ps aux". "F" flags 1 fork exec 4 sstat state "STAT" "S" D uninterruptible sleep (usually I/O) I idle kernel thread R S interruptible sleep (waiting for an event to complete) T t W paging (not valid since Linux 2.6) X Z defunct ("zombie") process, terminated but not reaped by its parent BSD stat < nice N nice L has pages locked into memory (for real-time and custom I/O) s l is multi-threaded (using CLONE_THREAD, like NPTL pthreads do) + These keys are used by the BSD O option (when it is used for sorting). The GNU --sort option doesn't use these keys, but the specifiers described below in the STANDARD FORMAT SPECIFIERS section. Note that the values used in sorting are the internal values ps uses and not the "cooked" values used in some of the output format fields (e.g., sorting on tty will sort into device number, not according to the terminal name displayed). Pipe ps output into the sort(1) command if you want to sort the cooked values. c cmd C pcpu CPU f flags F g pgrp ID G tpgid tty ID j cutime J cstime k utime m min_flt M maj_flt n cmin_flt N cmaj_flt o session ID p pid ID P ppid ID r rss R resident s size memory size in kibibytes S share t tty tty T start_time U uid ID u user v vsize VM (KiB) y priority AIX This ps supports AIX format descriptors, which work somewhat like the formatting codes of printf(1) and printf(3). The NORMAL codes are described in the next section. %C pcpu %CPU %G group GROUP %P ppid PPID %U user USER %a args COMMAND %c comm COMMAND %g rgroup RGROUP %n nice NI %p pid PID %r pgid PGID %t etime ELAPSED %u ruser RUSER %x time TIME %y tty TTY %z vsz VSZ -o GNU --sort ps -eo pid,user,args --sort user ps ps argscmdcommcommandfnameucmducommlstartbsdstartstart Code Header Description ------------------------------------------------------------------------ %cpu %CPU cpu "##.#" CPU (cputime/realtime) 100% pcpu %mem %MEM pmem ag_id AGID CFS ag_nice AGNI nice args COMMAND A command with all its arguments as a string. Modifications to the arguments may be shown. The output in this column may contain spaces. A process marked "" is partly dead, waiting to be fully destroyed by its parent. Sometimes the process arguments will be unavailable; when this happens, ps instead reports the executable name in brackets. (alias cmd, command). See also the comm format keyword, the -f option, and the c option. When specified last, this column will extend to the edge of the display. If ps can not determine the display width, as when output is redirected (piped) into a file or another command, the output width is undefined (it may be 80, unlimited, determined by the TERM variable, and so on). The COLUMNS environment variable or --cols option may be used to exactly determine the width in this case. The w or -w option may be also be used to adjust width. blocked BLOCKED signal(7) 32 64 --signames sig_blocksigmask bsdstart START 24 " HH:MM" " Mmm:SS" Mmm lstart start start_time stime bsdtime TIME CPU + "MMM:SS" CPU 999 c C processor utilization. Currently, this is the integer value of the percent usage over the lifetime of the process. (see %cpu). caught CAUGHT signal(7) 32 64 --signames sig_catchsigcatch cgname CGNAME cgroup CGROUP cgroupns CGROUPNS inode namespaces(7) class CLS policycls +9n - TS SCHED_OTHER FF SCHED_FIFO RR SCHED_RR B SCHED_BATCH ISO SCHED_ISO IDL SCHED_IDLE DLN SCHED_DEADLINE ? cls CLS policycls +9n - TS SCHED_OTHER FF SCHED_FIFO RR SCHED_RR B SCHED_BATCH ISO SCHED_ISO IDL SCHED_IDLE DLN SCHED_DEADLINE ? cmd CMD args argscommand comm COMMAND ucmducomm args -f c ps 80 TERM COLUMNS --cols w -w command COMMAND args argscommand cp CP CPU %cpu cputime TIME CPU "[DD-]hh:mm:ss" time cputimes TIME CPU times) cuc %CUC The CPU utilization of a process, including dead children, in an extended "##.###" format. (see also %cpu, c, cp, cuu, pcpu). cuu %CUU CPU "##.###" %cpuccpcucpcpu docker DOCKER The abbreviated id of the docker container within which a task is running. If a process is not running inside a container, a dash ('-') will be shown. drs DRS data resident set size, the amount of private memory reserved by a process. It is also known as DATA. Such memory may not yet be mapped to rss but will always be included in the vsz amount. egid EGID ID gid egroup EGROUP ID ID ID group eip EIP instruction pointer. As of kernel 4.9.xx will be zeroed out unless task is exiting or being core dumped. esp ESP stack pointer. As of kernel 4.9.xx will be zeroed out unless task is exiting or being core dumped. etime ELAPSED [[DD-]hh:]mm:ss etimes ELAPSED environ ENVIRON environment variables for the process. euid EUID ID uid euser EUSER ID ID n unameuser exe EXE path to the executable. Useful if path cannot be printed via cmd, comm or args format options. f F flagflags fds FDS total open file descriptors. fgid FGID ID fsgid fgroup FGROUP ID ID ID fsgroup flag F f fflags flags F f fflag fname COMMAND 8 fuid FUID ID fsuid fuser FUSER ID ID ID gid GID egid egid group GROUP egroup egroup htprv HTPRV The amount of private memory backed by hugetlbfs page which is not counted in the rss or pss format options. htshr HTSHR The amount of shared memory backed by hugetlbfs page which is not counted in the rss or pss format options. ignored IGNORED signal(7) 32 64 --signames sig_ignoresigignore ipcns IPCNS inode namespaces(7) label LABEL SELinux ("MAC") lstart STARTED time the command started. This will be in the form "DDD mmm HH:MM:SS YYY" unless changed by the -D option. lsession SESSION systemd luid LUID ID lwp LWP ID spid tid tid lxc LXC lxc ("-") machine MACHINE systemd VM maj_flt MAJFLT min_flt MINFLT mntns MNTNS inode namespaces(7) netns NETNS inode namespaces(7) ni NI nice value. This ranges from 19 (nicest) to -20 (not nice to others), see nice(1). (alias nice). nice NI ni ni nlwp NLWP LWP thcount numa NUMA -1 NUMA nwchan WCHAN wchan oom OOM Out of Memory Score. The value, ranging from 0 to +1000, used to select task(s) to kill when memory is exhausted. oomadj OOMADJ Out of Memory Adjustment Factor. The value is added to the current out of memory score which is then used to determine which task to kill when memory is exhausted. ouid OWNER systemd Unix pcap PCAP Permitted Capabilites of the process, displayed as a hexadecimal bitmask. See capabilities(7). pcaps PCAPS Permitted Capabilites of the process, displayed as a string of capability names. See capabilities(7). pcpu %CPU %cpu %cpu pending PENDING mask of the pending signals. See signal(7). Signals pending on the process are distinct from signals pending on individual threads. Use the m option or the -m option to see both. According to the width of the field, a 32 or 64 bits mask in hexadecimal format is displayed, unless the --signames option is used. (alias sig). pgid PGID ID ID pgrp pgrp PGRP pgid pgid pid PID ID tgid pidns PIDNS inode namespaces(7) pmem %MEM %mem %mem policy POL classcls +9n - TS SCHED_OTHER FF SCHED_FIFO RR SCHED_RR B SCHED_BATCH ISO SCHED_ISO IDL SCHED_IDLE DLN SCHED_DEADLINE ? ppid PPID ID pri PRI psr PSR pss PSS Proportional share size, the non-swapped physical memory, with shared memory proportionally accounted to all tasks mapping it. rbytes RBYTES Number of bytes which this process really did cause to be fetched from the storage layer. rchars RCHARS rgid RGID ID rgroup RGROUP ID ID rops ROPS Number of read I/O operations--that is, system calls such as read(2) and pread(2). rss RSS resident set size, the non-swapped physical memory that a task has used (in kibibytes). (alias rssize, rsz). rssize RSS rss rssrsz rsz RSZ rss rssrssize rtprio RTPRIO ruid RUID ID ruser RUSER ID ID ID s S stat state sched SCH SCHED_OTHER (SCHED_NORMAL), SCHED_FIFO, SCHED_RR, SCHED_BATCH, SCHED_ISO, SCHED_IDLE SCHED_DEADLINE 0, 1, 2, 3, 4, 5 6 seat SEAT systemd sess SESS ID ID sessionsid sgi_p P "" "" "*" sgid SGID ID svgid sgroup SGROUP ID ID sid SID sess sesssession sig PENDING pending pendingsig_pend sigcatch CAUGHT caught caughtsig_catch sigignore IGNORED ignored ignoredsig_ignore sigmask BLOCKED blocked blockedsig_block size SIZE slice SLICE systemd (slice unit) spid SPID lwp lwptid stackp STACKP start STARTED 24 "HH:MM:SS" " Mmm dd" Mmm bsdstartstartstart_time stime start_time START ps "MmmDD" "HH:MM" bsdstartstartlstart stime stat STAT s state state S s s stime STIME see start_time. (alias start_time). suid SUID ID svuid supgid SUPGID ID getgroups(2) supgrp SUPGRP getgroups(2) suser SUSER ID ID svuser svgid SVGID sgid sgid svuid SVUID suid suid sz SZ vsz rss tgid TGID pid ID thcount THCNT nlwp nlwp tid TID spidtid ID (pid) ID (pgrp) ID (sid) ID (tgid) tty ID (tpgid) time TIME CPU "[DD-]HH:MM:SS" cputime timens TIMENS inode namespaces(7) times TIME CPU cputimes tname TTY tty tttty tpgid TPGID tty ID tty -1 trs TRS text resident set size, the amount of physical memory devoted to executable code. tt TT tty tnametty tty TT tty tnamett ucmd CMD comm commucomm ucomm COMMAND comm commucmd uid UID euid euid uname USER euser euseruser unit UNIT systemd user USER euser euseruname userns USERNS inode namespaces(7) uss USS utsns UTSNS inode namespaces(7) uunit UUNIT systemd vsize VSZ vsz vsz vsz VSZ KiB1024 vsize wbytes WBYTES wcbytes WCBYTES wchan WCHAN wchars WCHARS Number of bytes which this task has caused, or shall cause to be written to disk. wops WOPS Number of write I/O operations--that is, system calls such as write(2) and pwrite(2). ps COLUMNS LINES PS_PERSONALITY Set to one of posix, old, linux, bsd, sun, digital... (see section PERSONALITY below). CMD_ENV Set to one of posix, old, linux, bsd, sun, digital... (see section PERSONALITY below). I_WANT_A_BROKEN_PS LC_TIME LIBPROC_HIDE_KERNEL -e --ppid 2 -p 2 --deselect BSD PS_COLORS PS_FORMAT -o DefSysV DefBSD POSIXLY_CORRECT "" POSIX2 "on" POSIXLY_CORRECT UNIX95 "" _XPG CMD_ENV=irix CMD_ENV PS_PERSONALITY Linuxps Unix98 390 OS/390 OpenEdition ps aix AIX ps bsd FreeBSD ps compaq Digital Unix ps debian Debian ps digital Tru64 Digital Unix OSF/1ps gnu Debian ps hp HP-UX ps hpux HP-UX ps irix Irix ps linux ***** ***** old Linux ps os390 OS/390 Open Edition ps posix s390 OS/390 Open Edition ps sco SCO ps sgi Irix ps solaris2 Solaris 2+ (SunOS 5) ps sunos4 SunOS 4 (Solaris 1) ps svr4 sysv tru64 Tru64 Digital Unix OSF/1ps unix unix95 unix98 bsdstart start lstart stime pgrep(1), pstree(1), top(1), strftime(3), proc(5), capabilities(7). This ps conforms to the following standards. o Single Unix Specification 2 o The Open Group Technical Standard Base Specifications 6 o IEEE Std 1003.12004 o X/Open System Interfaces Extension [UP XSI] o ISO/IEC 9945:2003 ps was originally written by Branko Lankester . Michael K. Johnson re-wrote it significantly to use the proc filesystem, changing a few things in the process. Michael Shields added the pid-list feature. Charles Blake added multi-level sorting, the dirent-style library, the device name-to-number mmaped database, the approximate binary search directly on System.map, and many code and documentation cleanups. David Mossberger-Tang wrote the generic BFD support for psupdate. Albert Cahalan rewrote ps for full Unix98 and BSD support, along with some ugly hacks for obsolete and foreign syntax. procps-ng 2024-09-17 PS(1)