PS(1)
๐ PS(1) ๐
General Commands Manual. Hey bestie, we're doing ps today. It's giving process snapshot energy. ๐ซถ
โจ NAME โจ
ps โ report a snapshot of the current processes. That's the whole point, no cap. ๐
โจ SYNOPSIS โจ
ps [option ...]
โจ DESCRIPTION โจ
ps displays information about a selection of the active processes. If you want a repetitive update of the selection and the displayed information, use top instead. ๐
This version of ps accepts several kinds of options.
- Unix options, which may be grouped and must be preceded by a dash.
- BSD options, which may be grouped and must not be used with a dash.
- GNU long options, which are preceded by two dashes.
Options of different types may be freely mixed, but conflicts can appear. There are some synonymous options, which are functionally identical, due to the many standards and ps implementations that this ps is compatible with. ๐
By default, ps selects all processes with the same effective user ID (euid=EUID) as the current user and associated with the same terminal as the invoker. It displays the process ID (pid=PID), the terminal associated with the process (tname=TTY), the cumulated CPU time in [DD-]hh:mm:ss format (time=TIME), and the executable name (ucmd=CMD). Output is unsorted by default. ๐
The use of BSD-style options will add process state (stat=STAT) to the default display and show the command args (args=COMMAND) instead of the executable name. You can override this with the PS_FORMAT environment variable. The use of BSD-style options will also change the process selection to include processes on other terminals (TTYs) that are owned by you; alternately, this may be described as setting the selection to be the set of all processes filtered to exclude processes owned by other users or not on a terminal. These effects are not considered when options are described as being "identical" below, so -M will be considered identical to Z and so on. โจ
Except as described below, process selection options are additive. The default selection is discarded, and then the selected processes are added to the set of processes to be displayed. A process will thus be shown if it meets any of the given selection criteria. ๐
โจ EXAMPLES โจ
To see every process on the system using standard syntax:
ps -e
ps -ef
ps -eF
ps -ely
To see every process on the system using BSD syntax:
ps ax
ps axu
To print a process tree:
ps -ejH
ps axjf
To get info about threads:
ps -eLf
ps axms
To get security info:
ps -eo euser,ruser,suser,fuser,f,comm,label
ps axZ
ps -eM
To see every process running as root (real & effective ID) in user format:
ps -U root -u root u
To see every process with a user-defined format:
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
Print only the process IDs of syslogd:
ps -C syslogd -o pid=
Print only the name of PID 42:
ps -q 42 -o comm=
๐ธ SIMPLE PROCESS SELECTION ๐ธ
aโ Lift the BSD-style "only yourself" restriction, which is imposed upon the set of all processes when some BSD-style (without-) options are used or when thepspersonality setting is BSD-like. The set of processes selected in this manner is in addition to the set of processes selected by other means. An alternate description is that this option causespsto list all processes with a terminal (tty), or to list all processes when used together with thexoption.-Aโ Select all processes. Identical to-e.-aโ Select all processes except both session leaders (seegetsid(2)) and processes not associated with a terminal.-dโ Select all processes except session leaders.--deselectโ Select all processes except those that fulfill the specified conditions (negates the selection). Identical to-N.-eโ Select all processes. Identical to-A.gโ Really all, even session leaders. This flag is obsolete and may be discontinued in a future release. It is normally implied by theaflag, and is only useful when operating in thesunos4personality.-Nโ Select all processes except those that fulfill the specified conditions (negates the selection). Identical to--deselect.Tโ Select all processes associated with this terminal. Identical to thetoption without any argument.rโ Restrict the selection to only running processes.xโ Lift the BSD-style "must have a tty" restriction, which is imposed upon the set of all processes when some BSD-style (without-) options are used or when thepspersonality setting is BSD-like. The set of processes selected in this manner is in addition to the set of processes selected by other means. An alternate description is that this option causespsto list all processes owned by you (same EUID asps), or to list all processes when used together with theaoption.
๐ PROCESS SELECTION BY LIST ๐
These options accept a single argument in the form of a blank-separated or comma-separated list. They can be used multiple times. For example: ps -p "1 2" -p 3,4 ๐
123โ Identical to--pid 123.+123โ Identical to--sid 123.-123โ Select by process group ID (PGID).-Ccmdlist โ Select by command name. This selects the processes whose executable name is given in cmdlist. NOTE: The command name is not the same as the command line. Previous versions ofprocpsand the kernel truncated this command name to 15 characters. This limitation is no longer present in both. If you depended on matching only 15 characters, you may no longer get a match.-Ggrplist โ Select by real group ID (RGID) or name. This selects the processes whose real group name or ID is in the grplist list. The real group ID identifies the group of the user who created the process, seegetgid(2).-ggrplist โ Select by session OR by effective group name. Selection by session is specified by many standards, but selection by effective group is the logical behavior that several other operating systems use. Thispswill select by session when the list is completely numeric (as sessions are). Group ID numbers will work only when some group names are also specified. See the-sand--groupoptions.--Groupgrplist โ Select by real group ID (RGID) or name. Identical to-G.--groupgrplist โ Select by effective group ID (EGID) or name. This selects the processes whose effective group name or ID is in grplist. The effective group ID describes the group whose file access permissions are used by the process (seegetegid(2)). The-goption is often an alternative to--group.ppidlist โ Select by process ID. Identical to-pand--pid.-ppidlist โ Select by PID. This selects the processes whose process ID numbers appear in pidlist. Identical topand--pid.--pidpidlist โ Select by process ID. Identical to-pandp.--ppidpidlist โ Select by parent process ID. This selects the processes with a parent process ID in pidlist. That is, it selects processes that are children of those listed in pidlist.qpidlist โ Select by process ID (quick mode). Identical to-qand--quick-pid.-qpidlist โ Select by PID (quick mode). This selects the processes whose process ID numbers appear in pidlist. With this optionpsreads the necessary info only for the pids listed in the pidlist and doesn't apply additional filtering rules. The order of pids is unsorted and preserved. No additional selection options, sorting and forest type listings are allowed in this mode. Identical toqand--quick-pid.--quick-pidpidlist โ Select by process ID (quick mode). Identical to-qandq.-ssesslist โ Select by session ID. This selects the processes with a session ID specified in sesslist.--sidsesslist โ Select by session ID. Identical to-s.tttylist โ Select by tty. Nearly identical to-tand--tty, but can also be used with an empty ttylist to indicate the terminal associated withps. Using theToption is considered cleaner than usingtwith an empty ttylist.-tttylist โ Select by tty. This selects the processes associated with the terminals given in ttylist. Terminals (ttys, or screens for text output) can be specified in several forms:/dev/ttyS1,ttyS1,S1. A plain-may be used to select processes not attached to any terminal.--ttyttylist โ Select by terminal. Identical to-tandt.Uuserlist โ Select by effective user ID (EUID) or name. This selects the processes whose effective user name or ID is in userlist. The effective user ID describes the user whose file access permissions are used by the process (seegeteuid(2)). Identical to-uand--user.-Uuserlist โ Select by real user ID (RUID) or name. It selects the processes whose real user name or ID is in the userlist list. The real user ID identifies the user who created the process, seegetuid(2).-uuserlist โ Select by effective user ID (EUID) or name. This selects the processes whose effective user name or ID is in userlist. The effective user ID describes the user whose file access permissions are used by the process (seegeteuid(2)). Identical toUand--user.--Useruserlist โ Select by real user ID (RUID) or name. Identical to-U.--useruserlist โ Select by effective user ID (EUID) or name. Identical to-uandU.
โจ OUTPUT FORMAT CONTROL โจ
okay bestie this is the section where you get to decide what actually shows up on screen ๐
these options pick which info ps hands you. heads up tho โ the output can differ depending on personality. and those things in brackets at the end of each description? those are the format equivalents, like the shortcut version of the same vibe. ๐
-cโ shows different scheduler information for the-loption. (-O cls,pri).--contextโ displays the security context format (for SELinux). (-o pid,context,cmd).-fโ do the full-format listing. you can combine this with tons of other Unix-style options to tack on extra columns, and it also makes the command arguments print out. when you use it with-L, theNLWP(number of threads) andLWP(thread ID) columns get added. see thecoption, the format keywordargs, and the format keywordcomm. (-o uid,pid,ppid,c,stime,tty,time,cmd).-Fโ extra full format. see the-foption, which-Fimplies. (-o uid,pid,ppid,c,sz,rss,psr,stime,tty,time,cmd).--formatformat โ user-defined format. literally identical to-oando.jโ BSD job control format. (-o ppid,pid,pgid,sid,tty,tpgid,stat,uid,time,cmd a)-jโ jobs format. (-o pid,pgid,sid,tty,time,ucmd)lโ display BSD long format. (-o f,uid,pid,ppid,pri,ni,vsz,rss,wchan,stat,tty,time,cmd a)-lโ long format. the-yoption is often useful alongside this one. (-o f,uid,pid,ppid,c,pri,ni,addr,sz,wchan,tty,time,ucmd)-Mโ add a column of security data. identical toZ(for SELinux). (-o context,pid,tty,time,ucmd)Oformat โ this one is preloadedo(overloaded, iconic behavior honestly). the BSDOoption can act like-O(user-defined output format with some common fields predefined) OR it can be used to specify sort order. heuristics are used to figure out which behavior you're getting. to make sure you actually get the behavior you want (sorting or formatting), specify the option some other way (e.g., with-Oor--sort). when it's used as a formatting option, it's identical to-O, with the BSD personality.-Oformat โ like-o, but preloaded with some default columns. identical to-o pid,format,state,tname,time,commandor-o pid,format,tname,time,cmd, see-obelow.oformat โ specify user-defined format. identical to-oand--format.-oformat โ user-defined format, the main character fr. 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) however you want. if all column headers are empty (ps -o pid= -o comm=) then the header line will not be output at all. column width will increase as needed for wide headers โ you can use this to widen up columns such asWCHAN(ps -o pid,wchan=WIDE-WCHAN-COLUMN -o comm). explicit width control (ps opid,wchan:42,cmd) is offered too. the behavior ofps -o pid=X,comm=Yvaries with personality; output may be one column named"X,comm=Y"or two columns named"X"and"Y". use multiple-ooptions when in doubt. use thePS_FORMATenvironment variable to specify a default as desired;DefSysVandDefBSDare macros that may be used to choose the default Unix or BSD columns.-Pโ add a column showingpsr. (-o pid,psr,s,tty,time,ucmd)sโ display signal format. (-o uid,pid,pending,blocked,ignored,caught,stat,tty,bsdtime,cmd a)uโ display user-oriented format. (-o user,pid,pcpu,pmem,vsz,rss,tty,stat,start_time,bsdtime,args a)vโ display virtual memory format. (-o pid,tty,stat,bsdtime,majflt,trs,drs,rss,pmem,args a)Xโ register format. (-o pid,stackp,esp,eip,tmout,alarm,stat,tty,bsdtime,args a)-yโ do not show flags; showrssin place ofaddr. this option can only be used with-l. โ ๏ธZโ add a column of security data. identical to-M(for SELinux).
๐ฆ OUTPUT MODIFIERS ๐ฆ
these ones tweak the vibe of what you already got โ headers, widths, delimiters, sorting, all that good stuff โจ
cโ show the true command name. this is derived from the name of the executable file, rather than from theargvvalue. command arguments and any modifications to them are thus not shown. this option effectively turns theargsformat keyword into thecommformat keyword; it's useful with the-fformat option and with the various BSD-style format options, which all normally display the command arguments. see the-foption, the format keywordargs, and the format keywordcomm.--colsn โ set screen width.--columnsn โ set screen width.--cumulativeโ include some dead child process data (as a sum with the parent).-Dformat โ set the date format of thelstartfield to format. this format is parsed bystrftime(3)and should be a maximum of 24 characters to not mis-align columns.--date-formatformat โ identical to-D.--delimiterdelim โ set the delimiter between each column to delim instead of variable space. must be a single character.eโ show the environment after the command.fโ ASCII art process hierarchy (forest). ๐ฒ--forestโ ASCII art process tree.hโ no header. (or, one header per screen in the BSD personality). okay so thehoption is lowkey problematic. standard BSDpsuses this option to print a header on each page of output, but older Linuxpsuses this option to totally disable the header. this version ofpsfollows the Linux usage of not printing the header unless the BSD personality has been selected, in which case it prints a header on each page of output. regardless of the current personality, you can use the long options--headersand--no-headersto enable printing headers each page or disable headers entirely, respectively.-Hโ show process hierarchy (forest).--headersโ repeat header lines, one per page of output.kspec โ specify sorting order. sorting syntax is[+|-]key[,[+|-]key[,...]]. choose a multi-letter key from the STANDARD FORMAT SPECIFIERS section. the"+"is optional since the default direction is increasing numerical or lexicographic order. identical to--sort.
examples, bestie:
ps jaxkuid,-ppid,+pid
ps axk comm o comm,args
ps kstart_time -ef
--linesn โ set screen height.nโ numeric output forWCHANandUSER(including all types ofUIDandGID).--no-headersโ print no header line at all.--no-headingis an alias for this option.Oorder โ sorting order (overloaded, again ๐). the BSDOoption 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-Oor--sort).
for sorting, the 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 it may help to distinguish an O sort from an O format. the "-" reverses direction only on the key it precedes.
--rowsn โ set screen height.Sโ sum up some information, such as CPU usage, from dead child processes into their parent. this is useful for examining a system where a parent process repeatedly forks off short-lived children to do work.--sortspec โ specify sorting order. sorting syntax is[+|-]key[,[+|-]key[,...]]. choose a multi-letter key from the STANDARD FORMAT SPECIFIERS section. the"+"is optional since the default direction is increasing numerical or lexicographic order. identical tok. for example:ps jax --sort=uid,-ppid,+pid--signamesโ show signal masks using abbreviated signal names and expands the column. if the column width cannot show all signals, the column will end with a plus"+". columns with only a hyphen have no signals.wโ wide output. use this option twice for unlimited width.-wโ wide output. use this option twice for unlimited width.--widthn โ set screen width.
๐ง THREAD DISPLAY ๐ง
threads thread threads โ let's peek at them ๐ซถ
Hโ show threads as if they were processes.-Lโ show threads, possibly withLWPandNLWPcolumns.mโ show threads after processes.-mโ show threads after processes.-Tโ show threads, possibly withSPIDcolumn.
๐ OTHER INFORMATION ๐
the little extras, the side quests, the ๐ on top
--helpsection โ print a help message. the section argument can be one ofsimple,list,output,threads,misc, orall. the argument can be shortened to one of the underlined letters as in:s|l|o|t|m|a.--infoโ print debugging info.Lโ list all format specifiers.Vโ print the procps-ng version.-Vโ print the procps-ng version.--versionโ print the procps-ng version.
๐ NOTES ๐
okay bestie, storytime: this ps works by reading the virtual files in /proc. that's it, that's the whole trick. it does not need to be setuid kmem and it does not need any privileges to run. so do not give this ps any special permissions, fr fr. ๐
โโ๏ธ
CPU usage? currently expressed as the percentage of time spent running during the entire lifetime of a process. is that ideal? no. does it conform to the standards that ps otherwise conforms to? also no. ๐ญ and it's unlikely to add up to exactly 100%. lowkey unhinged but that's the vibe.
the SIZE and RSS fields don't count some parts of a process, including the page tables, kernel stack, struct thread_info, and struct task_struct. this is usually at least 20 KiB of memory that is always resident. SIZE is the virtual size of the process (code+data+stack). ๐
processes marked <defunct> are dead processes (the so-called "zombies" ๐ง) that remain because their parent has not destroyed them properly. these processes will be destroyed by init(8) if the parent process exits. no cap.
if the length of the username is greater than the width of the display column, the username will be truncated. ๐ฌ see the -o and -O formatting options to customize length.
and now the big one, listen up: command 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. and if that user doesn't exist? then ps will assume you really meant "ps aux". so it works by accident. iconic behavior honestly. ๐
๐ฉ PROCESS FLAGS ๐ฉ
the sum of these values is displayed in the "F" column, which is provided by the flags output specifier:
1โ forked but didn't exec4โ used super-user privileges
๐ PROCESS STATE CODES ๐
here are the different values that the s, stat and state output specifiers (header "STAT" or "S") will display to describe the state of a process:
Dโ uninterruptible sleep (usually I/O)Iโ idle kernel threadRโ running or runnable (on run queue)Sโ interruptible sleep (waiting for an event to complete)Tโ stopped by job control signaltโ stopped by debugger during the tracingWโ paging (not valid since Linux 2.6)Xโ dead (should never be seen)Zโ defunct ("zombie") process, terminated but not reaped by its parent
for BSD formats and when the stat keyword is used, additional characters may be displayed:
<โ high-priority (not nice to other users)Nโ low-priority (nice to other users)Lโ has pages locked into memory (for real-time and custom I/O)sโ is a session leaderlโ is multi-threaded (usingCLONE_THREAD, like NPTL pthreads do)+โ is in the foreground process group
๐ฆ OBSOLETE SORT KEYS ๐ฆ
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โ simple name of executableC/pcpuโ cpu utilizationf/flagsโ flags as in long formatFfieldg/pgrpโ process group IDG/tpgidโ controlling tty process group IDj/cutimeโ cumulative user timeJ/cstimeโ cumulative system timek/utimeโ user timem/min_fltโ number of minor page faultsM/maj_fltโ number of major page faultsn/cmin_fltโ cumulative minor page faultsN/cmaj_fltโ cumulative major page faultso/sessionโ session IDp/pidโ process IDP/ppidโ parent process IDr/rssโ resident set sizeR/residentโ resident pagess/sizeโ memory size in kibibytesS/shareโ amount of shared pagest/ttyโ the device number of the controlling ttyT/start_timeโ time process was startedU/uidโ user ID numberu/userโ user namev/vsizeโ total VM size in KiBy/priorityโ kernel scheduling priority
๐ค AIX FORMAT DESCRIPTORS ๐ค
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โ normal:pcpuโ header:%CPU%Gโ normal:groupโ header:GROUP%Pโ normal:ppidโ header:PPID%Uโ normal:userโ header:USER%aโ normal:argsโ header:COMMAND%cโ normal:commโ header:COMMAND%gโ normal:rgroupโ header:RGROUP%nโ normal:niceโ header:NI%pโ normal:pidโ header:PID%rโ normal:pgidโ header:PGID%tโ normal:etimeโ header:ELAPSED%uโ normal:ruserโ header:RUSER%xโ normal:timeโ header:TIME%yโ normal:ttyโ header:TTY%zโ normal:vszโ header:VSZ
๐ STANDARD FORMAT SPECIFIERS ๐
here are the different keywords that may be used to control the output format (e.g., with option -o) or to sort the selected processes with the GNU-style --sort option.
for example:
ps -eo pid,user,args --sort user
this version of ps tries to recognize most of the keywords used in other implementations of ps. ๐ซถ
the following user-defined format specifiers may contain spaces: args, cmd, comm, command, fname, ucmd, ucomm, lstart, bsdstart, start.
some keywords may not be available for sorting.
%cpuโ header%CPUโ cpu utilization of the process in"##.#"format. currently, it is the CPU time used divided by the time the process has been running (cputime/realtimeratio), expressed as a percentage. it will not add up to 100% unless you are lucky. ๐ (aliaspcpu).%memโ header%MEMโ ratio of the process's resident set size to the physical memory on the machine, expressed as a percentage. (aliaspmem).ag_idโ headerAGIDโ the autogroup identifier associated with a process which operates in conjunction with the CFS scheduler to improve interactive desktop performance.ag_niceโ headerAGNIโ the autogroup nice value which affects scheduling of all processes in that group.argsโ headerCOMMANDโ a command with all its arguments as a string. modifications to the arguments may be shown. the column contents may include spaces. a process marked"<defunct>"is partly dead, waiting to be fully destroyed by its parent. sometimes the process arguments will be unavailable; when this happens,psinstead reports the executable name in brackets. (aliascmd,command). see also thecommformat keyword, the-foption, and thecoption.
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, which can be overridden with the --cols, --columns or --width 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โ headerBLOCKEDโ mask of the blocked signals, seesignal(7). according to the width of the field, a 32 or 64-bit mask in hexadecimal format is displayed, unless the--signamesoption is used. (aliassig_block,sigmask).bsdstartโ headerSTARTโ time the command started. if the process was started less than 24 hours ago, the output format is" HH:MM", else it is" Mmm:SS"(whereMmmis the three letters of the month). see alsolstart,start,start_time, andstime.bsdtimeโ headerTIMEโ accumulated cpu time, user + system. the display format is usually"MMM:SS", but can be shifted to the right if the process used more than 999 minutes of cpu time.cโ headerCโ processor utilization. currently, this is the integer value of the percent usage over the lifetime of the process. (see%cpu).caughtโ headerCAUGHTโ mask of the caught signals, seesignal(7). according to the width of the field, a 32 or 64 bits mask in hexadecimal format is displayed, unless the--signamesoption is used. (aliassig_catch,sigcatch).cgnameโ headerCGNAMEโ display name of control groups to which the process belongs.cgroupโ headerCGROUPโ display control groups to which the process belongs.cgroupnsโ headerCGROUPNSโ unique inode number describing the namespace the process belongs to. seenamespaces(7).classโ headerCLSโ scheduling class of the process. (aliaspolicy,cls). field's possible values are:cls,CLSโ the scheduling class of the process. It also answers topolicyandcls(yes, it's aliased to itself, main character behaviour honestly). The possible values are:-โ not reportedTSโSCHED_OTHERFFโSCHED_FIFORRโSCHED_RRBโSCHED_BATCHISOโSCHED_ISOIDLโSCHED_IDLEDLNโSCHED_DEADLINE?โ unknown value
cmd,CMDโ go look atargs. That's it, that's the entry. (aliasargs,command).comm,COMMANDโ the command name, but only the executable name part. Heads up: the output in this column may contain spaces, so don't come for me when your parsing gets weird. (aliasucmd,ucomm). Also go read theargsformat keyword, the-foption, and thecoption, they're all in this together.
And here's the spicy bit: when you put this column last, it stretches all the way to the edge of the display. But if ps can't figure out the display width โ like when the output gets redirected or piped into a file or another command โ then the output width is undefined. It might be 80, it might be unlimited, it might be whatever the TERM variable says, who even knows. To pin the width down exactly, use the COLUMNS environment variable or the --cols option. The w or -w option can also be used to adjust the width. ๐
command,COMMANDโ seeargs. (aliasargs,command).cp,CPโ per-mill (that's tenths of a percent) CPU usage. (see%cpu).cpu,CPUโ seepsr. (aliascpuid,lastcpu,psr).cpuid,CPUIDโ seepsr. (aliascpu,lastcpu,psr).cputime,TIMEโ cumulative CPU time, formatted like"[DD-]hh:mm:ss". (aliastime).cputimes,TIMEโ cumulative CPU time but in seconds. (aliastimes).cuc,%CUCโ the CPU utilization of a process, dead children included (yes, really), in an extended"##.###"format. (see also%cpu,c,cp,cuu,pcpu).cuu,%CUUโ the CPU utilization of a process in an extended"##.###"format. (see also%cpu,c,cp,cuc,pcpu).docker,DOCKERโ the abbreviated id of the docker container that a task is running inside of. If the process isn't in a container, you get a dash ('-'). Simple as that. ๐ณdrs,DRSโ data resident set size, aka the amount of private memory a process has reserved. It's also known asDATA. This memory might not be mapped torssyet, but it will always be included in thevszamount.egid,EGIDโ the effective group ID number of the process, as a decimal integer. (aliasgid).egroup,EGROUPโ the effective group ID of the process. You get the textual group ID if it can be obtained and the field width permits it, otherwise you get a decimal representation. (aliasgroup).eip,EIPโ instruction pointer. Lowkey important caveat: as of kernel4.9.xxit will be zeroed out unless the task is exiting or being core dumped. ๐ญesp,ESPโ stack pointer. Same deal aseip: as of kernel4.9.xxit gets zeroed out unless the task is exiting or being core dumped.etime,ELAPSEDโ elapsed time since the process was started, in the form[[DD-]hh:]mm:ss.etimes,ELAPSEDโ elapsed time since the process was started, in seconds.environ,ENVIRONโ environment variables for the process.euid,EUIDโ effective user ID (aliasuid).euser,EUSERโ effective user name. You get the textual user ID if it can be obtained and the field width permits it, otherwise it falls back to a decimal representation. Thenoption can force that decimal representation. (aliasuname,user).exe,EXEโ path to the executable. Super handy when the path can't be printed through thecmd,commorargsformat options. โจf,Fโ flags associated with the process. Go read the PROCESS FLAGS section. (aliasflag,flags).fds,FDSโ total open file descriptors.fgid,FGIDโ filesystem access group ID. (aliasfsgid).fgroup,FGROUPโ filesystem access group ID. Textual group ID if it can be obtained and the field width permits, decimal representation otherwise. (aliasfsgroup).flag,Fโ seef. (aliasf,flags).flags,Fโ seef. (aliasf,flag).fname,COMMANDโ the first 8 bytes of the base name of the process's executable file. And again, the output in this column may contain spaces.fuid,FUIDโ filesystem access user ID. (aliasfsuid).fuser,FUSERโ filesystem access user ID. Textual user ID if it can be obtained and the field width permits, decimal representation otherwise.gid,GIDโ seeegid. (aliasegid).group,GROUPโ seeegroup. (aliasegroup).htprv,HTPRVโ the amount of private memory backed by hugetlbfs page which is not counted in therssorpssformat options.htshr,HTSHRโ the amount of shared memory backed by hugetlbfs page which is not counted in therssorpssformat options.ignored,IGNOREDโ mask of the ignored signals, seesignal(7). Depending on how wide the field is, you get a 32 or 64 bits mask in hexadecimal format โ unless the--signamesoption is used. (aliassig_ignore,sigignore).ipcns,IPCNSโ unique inode number describing the namespace the process belongs to. Seenamespaces(7).label,LABELโ security label, most commonly used for SELinux context data. This one's for the Mandatory Access Control ("MAC") situation found on high-security systems. ๐lastcpu,Cโ seepsr. (aliascpu,cpuid,psr).lstart,STARTEDโ the time the command started. It comes in the form"DDD mmm HH:MM:SS YYY"unless the-Doption changed it.lsession,SESSIONโ displays the login session identifier of a process, but only if systemd support has been included. (conditional queen ๐ )luid,LUIDโ displays the Login ID associated with a process.lwp,LWPโ light weight process (thread) ID of the dispatchable entity. (aliasspid,tid). Seetidfor additional information.lxc,LXCโ the name of the lxc container a task is running inside of. If the process isn't in a container, you get a dash ('-').machine,MACHINEโ displays the machine name for processes assigned to a VM or container, if systemd support has been included.maj_flt,MAJFLTโ the number of major page faults that have occurred with this process.min_flt,MINFLTโ the number of minor page faults that have occurred with this process.mntns,MNTNSโ unique inode number describing the namespace the process belongs to. Seenamespaces(7).netns,NETNSโ unique inode number describing the namespace the process belongs to. Seenamespaces(7).ni,NIโ nice value. This ranges from19(nicest) to-20(not nice to others), seenice(1). (aliasnice).nice,NIโ seeni. (aliasni). (the alias circle continues, we stan a mutual)nlwp,NLWPโ number of lwps (threads) in the process. (aliasthcount).numa,NUMAโ the node associated with the most recently used processor. A-1means that NUMA information is unavailable.nwchan,WCHANโ address of the kernel function where the process is sleeping. Usewchaninstead if you want the actual kernel function name.oom,OOMโ Out of Memory Score. The value ranges from0to+1000, and it's what's used to pick the task(s) to kill when memory is exhausted. ๐oomadj,OOMADJโ Out of Memory Adjustment Factor. This value gets added to the current out of memory score, which is then used to decide which task to kill when memory is exhausted.ouid,OWNERโ displays the Unix user identifier of the owner of the session of a process, if systemd support has been included.pcap,PCAPโ Permitted Capabilities of the process, displayed as a hexadecimal bitmask. Seecapabilities(7).pcaps,PCAPSโ Permitted Capabilities of the process, displayed as a string of capability names. Seecapabilities(7).pcpu,%CPUโ see%cpu. (alias%cpu).pending(PENDING) โ the mask of the pending signals, bestie ๐ . Peepsignal(7)for the whole lore. Lowkey important: signals pending on the process are a completely different vibe from signals pending on individual threads, so if you wanna see both, hit themoption or the-moption. Depending on how wide the field is, you get a 32 or 64 bit mask in hexadecimal, unless you used--signames. (aliassig). ๐ฆpgid(PGID) โ process group ID, which is literally the same thing as the process ID of the process group leader. two names, one truth โจ. (aliaspgrp).pgrp(PGRP) โ seepgid. (aliaspgid).pid(PID) โ a number representing the process ID (aliastgid). the classic, the icon.pidns(PIDNS) โ unique inode number describing the namespace the process belongs to. Seenamespaces(7). ๐ธpmem(%MEM) โ see%mem. (alias%mem).policy(POL) โ scheduling class of the process. (aliasclass,cls). Possible values are:-not reportedTSSCHED_OTHERFFSCHED_FIFORRSCHED_RRBSCHED_BATCHISOSCHED_ISOIDLSCHED_IDLEDLNSCHED_DEADLINE?unknown value
ppid(PPID) โ parent process ID. the mother of all processes fr.pri(PRI) โ priority of the process. Higher number means higher priority, periodt.psr(PSR) โ processor that process last executed on. (aliascpu,cpuid,lastcpu).pss(PSS) โ Proportional share size, the non-swapped physical memory, with shared memory proportionally accounted to all tasks mapping it. the math is mathing ๐.rbytes(RBYTES) โ Number of bytes which this process really did cause to be fetched from the storage layer.rchars(RCHARS) โ Number of bytes which this task has caused to be read from storage.rgid(RGID) โ real group ID.rgroup(RGROUP) โ real group name. This will be the textual group ID, if it can be obtained and the field width permits, or a decimal representation otherwise. ๐rops(ROPS) โ Number of read I/O operationsโthat is, system calls such asread(2)andpread(2).rss(RSS) โ resident set size, the non-swapped physical memory that a task has used (in kibibytes). (aliasrssize,rsz).rssize(RSS) โ seerss. (aliasrss,rsz).rsz(RSZ) โ seerss. (aliasrss,rssize).rtprio(RTPRIO) โ realtime priority.ruid(RUID) โ real user ID.ruser(RUSER) โ real user ID. This will be the textual user ID, if it can be obtained and the field width permits, or a decimal representation otherwise.s(S) โ minimal state display (one character). See section PROCESS STATE CODES for the different values. See alsostatif you want additional information displayed. (aliasstate).sched(SCH) โ scheduling policy of the process. The policies SCHED_OTHER (SCHED_NORMAL), SCHED_FIFO, SCHED_RR, SCHED_BATCH, SCHED_ISO, SCHED_IDLE and SCHED_DEADLINE are respectively displayed as 0, 1, 2, 3, 4, 5 and 6. slay ๐seat(SEAT) โ displays the identifier associated with all hardware devices assigned to a specific workplace, if systemd support has been included.sess(SESS) โ session ID or, equivalently, the process ID of the session leader. (aliassession,sid).sgi_p(P) โ processor that the process is currently executing on. Displays "*" if the process is not currently running or runnable.sgid(SGID) โ saved group ID. (aliassvgid).sgroup(SGROUP) โ saved group name. This will be the textual group ID, if it can be obtained and the field width permits, or a decimal representation otherwise.sid(SID) โ seesess. (aliassess,session).sig(PENDING) โ seepending. (aliaspending,sig_pend).sigcatch(CAUGHT) โ seecaught. (aliascaught,sig_catch).sigignore(IGNORED) โ seeignored. (aliasignored,sig_ignore).sigmask(BLOCKED) โ seeblocked. (aliasblocked,sig_block).size(SIZE) โ approximate amount of swap space that would be required if the process were to dirty all writable pages and then be swapped out. Heads up bestie, this number is very rough!slice(SLICE) โ displays the slice unit which a process belongs to, if systemd support has been included.spid(SPID) โ seelwp. (aliaslwp,tid).stackp(STACKP) โ address of the bottom (start) of stack for the process.start(STARTED) โ time the command started. If the process was started less than 24 hours ago, the output format is "HH:MM:SS", else it is " Mmm dd" (where Mmm is a three-letter month name). See alsobsdstart,start,start_time, andstime.start_time(START) โ starting time or date of the process. Only the year will be displayed if the process was not started the same year ps was invoked, or "MmmDD" if it was not started the same day, or "HH:MM" otherwise. See alsobsdstart,start,lstart, andstime.stat(STAT) โ multi-character process state. See section PROCESS STATE CODES for the different values meaning. See alsosandstateif you just want the first character displayed.state(S) โ sees. (aliass).stime(STIME) โ seestart_time. (aliasstart_time).suid(SUID) โ saved user ID. (aliassvuid).supgid(SUPGID) โ group ids of supplementary groups, if any. Seegetgroups(2).supgrp(SUPGRP) โ group names of supplementary groups, if any. Seegetgroups(2).suser(SUSER) โ saved user name. This will be the textual user ID, if it can be obtained and the field width permits, or a decimal representation otherwise. (aliassvuser).svgid(SVGID) โ seesgid. (aliassgid).svuid(SVUID) โ seesuid. (aliassuid).sz(SZ) โ size in physical pages of the core image of the process. This includes text, data, and stack space. Device mappings are currently excluded; this is subject to change. Seevszandrss.tgid(TGID) โ a number representing the thread group to which a task belongs (aliaspid). It is the process ID of the thread group leader.thcount(THCNT) โ seenlwp. (aliasnlwp). number of kernel threads owned by the process.tid(TID) โ the unique number representing a dispatchable entity (aliasspid,tid). This value may also appear as: a process ID (pid); a process group ID (pgrp); a session ID for the session leader (sid); a thread group ID for the thread group leader (tgid); and a tty process group ID for the process group leader (tpgid).time(TIME) โ cumulative CPU time, "[DD-]HH:MM:SS" format. (aliascputime).timens(TIMENS) โ Unique inode number describing the namespace the process belongs to. Seenamespaces(7).times(TIME) โ cumulative CPU time in seconds (aliascputimes).tname(TTY) โ controlling tty (terminal). (aliastt,tty).tpgid(TPGID) โ ID of the foreground process group on the tty (terminal) that the process is connected to, or -1 if the process is not connected to a tty.trs(TRS) โ text resident set size, the amount of physical memory devoted to executable code.tt(TT) โ controlling tty (terminal). (aliastname,tty).tty(TT) โ controlling tty (terminal). (aliastname,tt).ucmd(CMD) โ seecomm. (aliascomm,ucomm).ucomm(COMMAND) โ seecomm. (aliascomm,ucmd).uid(UID) โ seeeuid. (aliaseuid).uname(USER) โ seeeuser. (aliaseuser,user).unit(UNIT) โ displays unit which a process belongs to, if systemd support has been included.user(USER) โ seeeuser. (aliaseuser,uname).userns(USERNS) โ Unique inode number describing the namespace the process belongs to. Seenamespaces(7).uss(USS) โ Unique set size, the non-swapped physical memory, which is not shared with an another task.utsns(UTSNS) โ Unique inode number describing the namespace the process belongs to. Seenamespaces(7).uunit(UUNIT) โ displays user unit which a process belongs to, if systemd support has been included.vsize(VSZ) โ seevsz. (aliasvsz).vsz(VSZ) โ virtual memory size of the process in KiB (1024-byte units). Device mappings are currently excluded; this is subject to change. (aliasvsize).wbytes(WBYTES) โ Number of bytes which this process caused to be sent to the storage layer.wcbytes(WCBYTES) โ Number of cancelled write bytes.wchan,WCHANโ the name of the kernel function your process is snoozing inside. it's giving "what is it waiting on" but make it โจmysteriousโจwchars,WCHARSโ how many bytes this task has caused, or is about to cause, to be written to disk. little bookkeeper energy ๐พwops,WOPSโ number of write I/O operations, aka system calls likewrite(2)andpwrite(2). bestie is counting her syscalls fr fr
๐ธ ENVIRONMENT VARIABLES ๐ธ
okay so these env vars could affect ps, and by "could" i mean they absolutely will, no cap:
COLUMNSโ override the default display width. make it as wide as your dreams ๐ฆLINESโ override the default display height. tall or short, she's flexible ๐PS_PERSONALITYโ set it to one ofposix,old,linux,bsd,sun,digital... (go check the PERSONALITY section below, i got you ๐ซถ)CMD_ENVโ set it to one ofposix,old,linux,bsd,sun,digital... (again, PERSONALITY section, scroll down bestie)I_WANT_A_BROKEN_PSโ forces the obsolete command line interpretation. yes that is literally the name. iconic, unhinged, we love her ๐LC_TIMEโ controls the date format. the vibe of your timestamps, essentially โจLIBPROC_HIDE_KERNELโ set this to any value to hide kernel threads, which are normally shown with the-eoption. this is equivalent to selecting--ppid 2 -p 2 --deselectinstead. also works in BSD mode. sneak mode activated ๐PS_COLORSโ not currently supported. rip to a real one, we miss her ๐ญPS_FORMATโ default output format override. you can set this to a format string of the type used for the-ooption. theDefSysVandDefBSDvalues are particularly useful. highly recommend, ate ๐ฅPOSIXLY_CORRECTโ don't find excuses to ignore bad "features". (yes the scare quotes are doing a LOT of work there, and yes they're in the original, i'm just the messenger ๐ )POSIX2โ when set to"on", acts asPOSIXLY_CORRECT.UNIX95โ don't find excuses to ignore bad "features"._XPGโ cancels theCMD_ENV=irixnon-standard behavior.
in general, it is a bad idea to set these variables. like, please don't, bestie. ๐
the one exception is CMD_ENV or PS_PERSONALITY, which could be set to Linux for normal systems. without that setting, ps follows the useless and bad parts of the Unix98 standard. and we don't stan useless and bad parts, periodt ๐
๐ PERSONALITY ๐
pick your fighter:
390โ like the OS/390 OpenEditionpsaixโ like AIXpsbsdโ like FreeBSDps(totally non-standard)compaqโ like Digital Unixpsdebianโ like the old Debianpsdigitalโ like Tru64 (was Digital Unix, was OSF/1)psgnuโ like the old Debianpshpโ like HP-UXpshpuxโ like HP-UXpsirixโ like Irixpslinuxโ * recommended * ๐ (this is the one, choose this one)oldโ like the original Linuxps(totally non-standard)os390โ like OS/390 Open Editionpsposixโ standards390โ like OS/390 Open Editionpsscoโ like SCOpssgiโ like Irixpssolaris2โ like Solaris 2+ (SunOS 5)pssunos4โ like SunOS 4 (Solaris 1)ps(totally non-standard)svr4โ standardsysvโ standardtru64โ like Tru64 (was Digital Unix, was OSF/1)psunixโ standardunix95โ standardunix98โ standard
the range?? the versatility?? she contains multitudes ๐
๐ BUGS ๐
okay so listen, not everything is perfect, and we have to be honest about it:
- the fields
bsdstartandstartwill only show the abbreviated month name in English. soz to everyone else ๐ฅฒ - the fields
lstartandstimewill show the abbreviated month name in the configured locale, but may exceed the column width โ because abbreviated month and day names have different lengths across languages. so your columns might get a little... chaotic. it's giving "formatting? never heard of her" ๐ญ
๐ฆ SEE ALSO ๐ฆ
go read these next, bestie, they're all bangers:
pgrep(1), pstree(1), top(1), strftime(3), proc(5), capabilities(7).
โญ STANDARDS โญ
this ps conforms to the following standards. she's certified, she's accredited, she has papers ๐โจ
- Version 2 of the Single Unix Specification
- The Open Group Technical Standard Base Specifications, Issue 6
- IEEE Std 1003.1, 2004 Edition
- X/Open System Interfaces Extension [UP XSI]
- ISO/IEC 9945:2003
๐ AUTHOR ๐
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.
look at this lineup. legends only. the way they all just kept adding features?? main character energy, all of them ๐
please send bug reports to procps@freelists.org. No subscription is required or suggested. just show up and say what's wrong, we're all friends here ๐ซถ
aaaand that's a wrap on ps(1), bestie!! ๐ this one's from the procps-ng crew and the page is dated 2025-04-23 โ so it's giving fresh, it's giving current, it's giving "yes we actually maintain this." go forth and ps aux responsibly, you absolute icon ๐
โจ๐ธ
๐ฆ where this page comes from
- arch rolling: procps-ng 4.0.7-1 ยท GPL AND LGPL
- nixpkgs unstable: procps 4.0.7
- Copyright (c) 2004-2025 Craig Small <csmall@dropbear.xyz>
- Copyright (c) 2011-2023 Jim Warner <james.warner@comcast.net>
- Copyright (c) 2011-2012 Sami Kerola <kerolasa@iki.fi>
- Copyright (c) 1998-2003 Albert Cahalan
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms