PS(1) PS(1) ps -- . ps [] ps . , top. ps : 1 UNIX, . 2 BSD, . 3 GNU, . , . , . ps, ps. , ps (euid=EUID), , , ' , . (pid=PID), , ' (tname=TTY), [-]:: (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 ( ) : 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: 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, , BSD ( <<->>) ps BSD. , , , . , ps , ( EUID, ps) , a. . . : ps -p "1 2" -p 3,4 123 , --pid 123. +123 , --sid 123. -123 (PGID). -C _ . , , _. : , . procps 15 . . 15 , . -G _ (RGID) . , _. , , . getgid(2). -g grplist . , , . ps , ( ). , . . -s --group. --Group grplist (RGID) . , -G. --group grplist (EGID) . , _. , (. getegid(2)). -g --group. p _pid . , -p --pid. -p _pid PID. , ' pidlist. , p --pid. --pid _pid . , -p p. --ppid _pid . _pid. , , _pid. q _pid ( ). , -q --quick-pid. -q _pid PID ( ). , _pid. , ps pid _pid . pid . , <<>>. , q --quick-pid. --quick-pid _pid ( ). , -q q. -s sesslist . , sesslist. --sid sesslist . , -s. t _ . , -t --tty, _, , ' ps. T t _. -t _ . , ' , _. (tty ) : /dev/ttyS1, ttyS1, S1. <<->> , ' - . --tty ttylist . , -t t. U _ (EUID) . , _. , (. geteuid(2)). -u --user. -U _ (RUID) . , _. , , . getuid(2). -u _ (EUID) . , _. , (. geteuid(2)). U --user. --User _ ' (RUID). -U. --user (EUID). , -u U. , ps. . -c -l. --context ( SELinux). -f . UNIX . . -L, NLWP ( ) LWP ( ). . c, args comm. -F . . -f, -F. --format . -o o. j BSD. -j . l BSD. -l . -y. -M . , Z ( SELinux). O o (). O BSD -O ( ) . . ( ) (, -O --sort). , -O BSD. -O -o, . -o pid,, state,tname,time,command -o pid,, tname,time,cmd, . -o . o . , -o --format. -o . , . . , , (ps -o pid, ruser=RealUser -o comm=Command). (ps -o pid= -o comm=), . ; , WCHAN (ps -o pid,wchan=WIDE-WCHAN-COLUMN -o comm). (ps opid, wchan:42,cmd). ps -o pid=X,comm=Y ; <> <> <>. -o, . PS_FORMAT ; DefSysV DefBSD , UNIX BSD. -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 lstart . strftime(3). 24 , . --date-format , -D. e . f () ASCII. --forest ASCII. h ( BSD). h . ps BSD , ps Linux . ps Linux -- , BSD, . , , --headers --no-headers, , . -H (). --headers , . k . : [+|-].RB [,[ + | - ].IR [,...]]. . <<+>> ', . , --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 (). O BSD --sort ( ) . . ( ) (, -O --sort). , O BSD : O[+|-]k1[,[+|-]k2[,...]]. , k1, k2, ..., . <<+>> ', , O O. <<->> , . --rows n . S , , . , . --sort : [+|-][,[+|-][,...]]. . <<+>> ', . , k. : ps jax --sort=uid,-ppid,+pid --signames . , , <<+>>. , , . w . , . -w . , . --width n . H , . -L , , LWP NLWP. m . -m . -T , , SPID. --help . simple (), list (), output (), threads (), misc () all (). , : s|l|o|t|m|a. --info . L . V procps-ng. -V procps-ng. --version procps-ng. ps /proc. ps setuid kmem . ps . , . , , ps . , 100%. SIZE RSS , , , thread_info task_struct. , , 20 ', . SIZE (++). , , ( <<>>), , . init(8), . , ' . -o -O. , ps -aux, . POSIX UNIX, (, , ) , x. , ps , <>. <>, flags: 1 , 4 , s, stat state ( <> <>), : D (, -) I R ( ) S ( ) T t W ( 2.6.xx) X ( ) Z (<<>>), , BSD, stat, : < ( ) N ( ) L ' ( ) s l ( CLONE_THREAD, , pthreads NPTL) + O BSD ( ). --sort GNU , . , , , , ps, <<>> , (, , ). ps sort(1), . c cmd C pcpu f flags , F g pgrp G tpgid j cutime J cstime k utime m min_flt M maj_flt n cmin_flt N cmaj_flt o session p pid P ppid r rss R resident ' s size ' S share t tty T start_time , U uid u ' v vsize y priority AIX ps AIX, printf(1) printf(3). , : ps -eo "%p %y %x %c". NORMAL . CODE NORMAL HEADER %C pcpu %CPU %G group GROUP %P ppid PPID %U USER %a args %c comm %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) --sort GNU. : ps -eo pid,user,args --sort user ps , ps. : args,cmd,comm,command,fname,ucmd,ucomm, lstart,bsdstart,start. . CODE HEADER %cpu %CPU <<##.#>>. , ( << / >>), . 100% ( -- pcpu). %mem %MEM ' ', ( -- pmem). ag_id AGID , ' , CFS . ag_nice AGNI , . args . . . , , , . . , ps ( - cmd, command). . comm, -f c. , . ps , , () , ( 80, , TERM ). COLUMNS --cols. w -w. blocked BLOCKED , . signal(7). , 32- 64- , --signames ( - sig_block, sigmask). bsdstart START 24 , <<:>>, , << >> ( <<>> -- ). . lstart, start, start_time stime. bsdtime TIME , + . , , <<:>>, , 999 . c C . (. %cpu). caught CAUGHT , . signal(7). , 32- 64- , --signames ( - sig_catch, sigcatch). cgname CGNAME , . cgroup CGROUP , . cgroupns CGROUPNS inode, , . . namespaces(7). class CLS . ( -- policy, cls). : +9n - TS SCHED_OTHER FF SCHED_FIFO RR SCHED_RR B SCHED_BATCH ISO SCHED_ISO IDL SCHED_IDLE DLN SCHED_DEADLINE ? cls CLS . ( -- policy, cls). : +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 ( - args, command). comm ( ). . ( - ucmd, ucomm). . args, -f c. , . ps , , () , ( 80, , TERM ). COLUMNS --cols. w -w. command . args. ( - args, command). cp CP ( ) (. %cpu). cputime TIME <<[-]::>> ( -- time). cputimes TIME ( - times). cuc %CUC , , <<##.###>>. (. %cpu, c, cp, cuu, pcpu). cuu %CUU , <<##.###>>. (. %cpu, c, cp, cuc, pcpu). drs DRS ' , ', . DATA. ' ' rss, vsz. egid EGID ( - gid). egroup EGROUP . , , , , . ( - group). eip EIP . 4.9.xx , . esp ESP . 4.9.xx , . etime ELAPSED , [[-]:]:. etimes ELAPSED , , . euid EUID ( - uid). euser EUSER ' . , , , . n. ( - uname, user). exe EXE . , cmd, comm args. f F , ' , . . ( - flag, flags). fgid FGID ( - fsgid). fgroup FGROUP . , , , , . ( - fsgroup). flag F . f ( - f, flags). flags F . f ( - f, flag). fname 8 . . fuid FUID ( - fsuid). fuser FUSER . , , , . gid GID . egid ( egid). group GROUP . egroup ( - egroup). ignored IGNORED , . signal(7). , 32- 64- , --signames ( - sig_ignore, sigignore). ipcns IPCNS inode, , . . namespaces(7). label LABEL , SELinux. Mandatory Access Control (<>) . lstart STARTED , . << :: >>, -D. lsession SESSION , systemd. luid LUID , ' . lwp LWP () ( - spid, tid). . tid, . lxc LXC LXC, . , (<<->>). machine MACHINE ' , ' , systemd. maj_flt MAJFLT , . min_flt MINFLT , . mntns MNTNS inode, , . . namespaces(7). netns NETNS inode, , . . namespaces(7). ni NI nice. -- 19 ( ) -20 ( ), . nice(1) ( - nice). nice NI . ni. ( ni). nlwp NLWP lwps ( ) ( - thcount). numa NUMA , ' . -1, NUMA . nwchan WCHAN , (, wchan, ). oom OOM '. 0 +1000, , , '. oomadj OOMADJ '. , ' (OOM), , , ' . ouid OWNER Unix , systemd. pcpu %CPU . %cpu ( - %cpu). pending PENDING . . signal(7). . m -m . , 32- 64- , --signames ( - sig). pgid PGID , , ( - pgrp). pgrp PGRP . pgid ( - pgid). pid PID , ( - tgid). pidns PIDNS inode, , . . namespaces(7). pmem %MEM . %mem ( - %mem). policy POL . ( -- class, cls). : +9n - TS SCHED_OTHER FF SCHED_FIFO RR SCHED_RR B SCHED_BATCH ISO SCHED_ISO IDL SCHED_IDLE DLN SCHED_DEADLINE ? ppid PPID . pri PRI . -- . psr PSR , . pss PSS , ' ' , , '. rbytes RBYTES , . rchars RCHARS , . rgid RGID . rgroup RGROUP . , , , . rops ROPS - , read(2) pread(2). rss RSS , ', ( ) ( - rssize, rsz). rssize RSS . rss ( - rss, rsz). rsz RSZ . rss ( - rss, rssize). rtprio RTPRIO . ruid RUID . ruser RUSER . , , , . 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 , ' , systemd. sess SESS , , . ( session, sid). sgi_p P , . <<*>>, . sgid SGID . ( svgid). sgroup SGROUP . , , , . sid SID . sess. ( sess, session). sig PENDING . pending. ( pending, sig_pend). sigcatch CAUGHT . caught. ( caught, sig_catch). sigignore IGNORED . ignored. ( ignored, sig_ignore). sigmask BLOCKED . blocked. ( blocked, sig_block). size SIZE ', , '. ! slice SLICE , , systemd. spid SPID . lwp. ( lwp, tid). stackp STACKP () . start STARTED . 24 , <<::>>, , << >> ( <<>> -- ). . bsdstart, start, start_time stime. start_time START . , ps, <<>>, , <<:>> . . bsdstart, start, lstart stime. stat STAT . . , . . s state, . state S . s. ( s). stime STIME . start_time. ( start_time). suid SUID ( - svuid). supgid SUPGID , . . getgroups(2). supgrp SUPGRP , . . getgroups(2). suser SUSER ' . , , , ( - svuser). svgid SVGID . sgid ( - sgid). svuid SVUID . suid. ( suid). sz SZ . , . ' ; . . vsz rss. tgid TGID , , ( - pid). . thcount THCNT . nlwp ( - nlwp), , . tid TID , ( - spid, spid). (pid); (pgrp); (sid); (tgid) (tpgid). time TIME <<[-]::>> ( -- cputime). timens TIMENS inode, , . . namespaces(7). times TIME ( - cputimes). tname TTY tty () ( - tt, tty). tpgid TPGID tty (), ' , -1, ' . trs TRS , ', . tt TT tty () ( - tname, tty). tty TT tty () ( - tname, tt). ucmd CMD . comm ( - comm, ucomm). ucomm . comm. ( comm, ucmd). uid UID . euid. ( euid). uname USER . euser. ( euser, user). unit UNIT , , systemd. USER . euser. ( euser, uname). userns USERNS inode, , . . namespaces(7). uss USS , ', . utsns UTSNS inode, , . . namespaces(7). uunit UUNIT , , systemd. vsize VSZ . vsz. ( vsz). vsz VSZ ' (1024- ). ' ; ( - vsize). wbytes WBYTES , . wcbytes WCBYTES , . wchan WCHAN , . wchars WCHARS , . wops WOPS - , write(2) pwrite(2). ps : COLUMNS . LINES . PS_PERSONALITY : posix, old, linux, bsd, sun, digital... (. ). CMD_ENV : posix, old, linux, bsd, sun, digital... (. ). 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 <>, POSIXLY_CORRECT. UNIX95 <<>>. _XPG CMD_ENV=irix. , . CMD_ENV PS_PERSONALITY, Linux . ps Unix98. 390 ps OS/390 OpenEdition aix ps AIX bsd ps FreeBSD ( ) compaq ps Digital Unix debian ps Debian digital ps Tru64 ( Digital Unix, OSF/1) gnu ps Debian .. ps HP-UX hpux ps HP-UX irix ps Irix linux ***** ***** old ps Linux ( ) os390 ps OS/390 Open Edition posix standard s390 ps OS/390 Open Edition sco ps SCO sgi ps Irix solaris2 ps Solaris 2+ (SunOS 5) sunos4 ps SunOS 4 (Solaris 1) ( ) svr4 standard sysv standard tru64 ps Tru64 ( Digital Unix, OSF/1) unix standard unix95 standard unix98 standard bsdstart start . lstart stime , . pgrep(1), pstree(1), top(1), strftime(3), proc(5). ps : 1 2 Single Unix Specification 2 The Open Group Technical Standard Base Specifications, 6 3 IEEE Std 1003.1, 2004 Edition 4 X/Open System Interfaces Extension [UP XSI] 5 ISO/IEC 9945:2003 ps Branko Lankester . Michael K. Johnson proc, . Michael Shields pid. Charles Blake , dirent, ' , System.map, . David Mossberger-Tang BFD psupdate. Albert Cahalan ps Unix98 BSD, . , , . '. procps-ng 19 2023 PS(1)