{
    "mode": "man",
    "parameter": "ps",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/man/ps/json",
    "generated": "2026-06-15T12:43:18Z",
    "synopsis": "ps [options]",
    "sections": {
        "NAME": {
            "content": "ps - report a snapshot of the current processes.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ps [options]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "ps displays information about a selection of the active processes.  If you want a repetitive\nupdate of the selection and the displayed information, use top instead.\n\nThis version of ps accepts several kinds of options:\n\n1   UNIX options, which may be grouped and must be preceded by a dash.\n2   BSD options, which may be grouped and must not be used with a dash.\n3   GNU long options, which are preceded by two dashes.\n\nOptions of different types may be freely mixed, but conflicts can appear.  There are some\nsynonymous options, which are functionally identical, due to the many standards and ps\nimplementations that this ps is compatible with.\n\nNote that ps -aux is distinct from ps aux.  The POSIX and UNIX standards require that ps -aux\nprint all processes owned by a user named x, as well as printing all processes that would be\nselected by the -a option.  If the user named x does not exist, this ps may interpret the\ncommand as ps aux instead and print a warning.  This behavior is intended to aid in\ntransitioning old scripts and habits.  It is fragile, subject to change, and thus should not\nbe relied upon.\n\nBy default, ps selects all processes with the same effective user ID (euid=EUID) as the\ncurrent user and associated with the same terminal as the invoker.  It displays the process\nID (pid=PID), the terminal associated with the process (tname=TTY), the cumulated CPU time in\n[DD-]hh:mm:ss format (time=TIME), and the executable name (ucmd=CMD).  Output is unsorted by\ndefault.\n\nThe use of BSD-style options will add process state (stat=STAT) to the default display and\nshow the command args (args=COMMAND) instead of the executable name.  You can override this\nwith the PSFORMAT environment variable.  The use of BSD-style options will also change the\nprocess selection to include processes on other terminals (TTYs) that are owned by you;\nalternately, this may be described as setting the selection to be the set of all processes\nfiltered to exclude processes owned by other users or not on a terminal.  These effects are\nnot considered when options are described as being \"identical\" below, so -M will be\nconsidered identical to Z and so on.\n\nExcept as described below, process selection options are additive.  The default selection is\ndiscarded, and then the selected processes are added to the set of processes to be displayed.\nA process will thus be shown if it meets any of the given selection criteria.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "To see every process on the system using standard syntax:\nps -e\nps -ef\nps -eF\nps -ely\n\nTo see every process on the system using BSD syntax:\nps ax\nps axu\n\nTo print a process tree:\nps -ejH\nps axjf\n\nTo get info about threads:\nps -eLf\nps axms\n\nTo get security info:\nps -eo euser,ruser,suser,fuser,f,comm,label\nps axZ\nps -eM\n\nTo see every process running as root (real & effective ID) in user format:\nps -U root -u root u\n\nTo see every process with a user-defined format:\nps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm\nps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm\nps -Ao pid,tt,user,fname,tmout,f,wchan\n\nPrint only the process IDs of syslogd:\nps -C syslogd -o pid=\n\nPrint only the name of PID 42:\nps -q 42 -o comm=\n",
            "subsections": []
        },
        "SIMPLE PROCESS SELECTION": {
            "content": "a      Lift the BSD-style \"only yourself\" restriction, which is imposed upon the set of all\nprocesses when some BSD-style (without \"-\") options are used or when the ps\npersonality setting is BSD-like.  The set of processes selected in this manner is in\naddition to the set of processes selected by other means.  An alternate description is\nthat this option causes ps to list all processes with a terminal (tty), or to list all\nprocesses when used together with the x option.\n",
            "subsections": [
                {
                    "name": "-A -e",
                    "content": "",
                    "flag": "-e"
                },
                {
                    "name": "-a",
                    "content": "associated with a terminal.\n",
                    "flag": "-a"
                },
                {
                    "name": "-d",
                    "content": "",
                    "flag": "-d"
                },
                {
                    "name": "--deselect",
                    "content": "Select all processes except those that fulfill the specified conditions (negates the\nselection).  Identical to -N.\n",
                    "long": "--deselect"
                },
                {
                    "name": "-e -A",
                    "content": "g      Really all, even session leaders.  This flag is obsolete and may be discontinued in a\nfuture release.  It is normally implied by the a flag, and is only useful when\noperating in the sunos4 personality.\n",
                    "flag": "-A"
                },
                {
                    "name": "-N",
                    "content": "selection).  Identical to --deselect.\n\nT      Select all processes associated with this terminal.  Identical to the t option without\nany argument.\n\nr      Restrict the selection to only running processes.\n\nx      Lift the BSD-style \"must have a tty\" restriction, which is imposed upon the set of all\nprocesses when some BSD-style (without \"-\") options are used or when the ps\npersonality setting is BSD-like.  The set of processes selected in this manner is in\naddition to the set of processes selected by other means.  An alternate description is\nthat this option causes ps to list all processes owned by you (same EUID as ps), or to\nlist all processes when used together with the a option.\n",
                    "flag": "-N"
                }
            ]
        },
        "PROCESS SELECTION BY LIST": {
            "content": "These options accept a single argument in the form of a blank-separated or comma-separated\nlist.  They can be used multiple times.  For example: ps -p \"1 2\" -p 3,4\n\n-123   Identical to --pid 123.\n\n123    Identical to --pid 123.\n",
            "subsections": [
                {
                    "name": "-C",
                    "content": "Select by command name.  This selects the processes whose executable name is given in\ncmdlist.  NOTE: The command name is not the same as the command line. Previous\nversions of procps and the kernel truncated this command name to 15 characters. This\nlimitation is no longer present in both. If you depended on matching only 15\ncharacters, you may no longer get a match.\n",
                    "flag": "-C"
                },
                {
                    "name": "-G",
                    "content": "Select by real group ID (RGID) or name.  This selects the processes whose real group\nname or ID is in the grplist list.  The real group ID identifies the group of the user\nwho created the process, see getgid(2).\n",
                    "flag": "-G"
                },
                {
                    "name": "-g",
                    "content": "Select by session OR by effective group name.  Selection by session is specified by\nmany standards, but selection by effective group is the logical behavior that several\nother operating systems use.  This ps will select by session when the list is\ncompletely numeric (as sessions are).  Group ID numbers will work only when some group\nnames are also specified.  See the -s and --group options.\n\n--Group grplist\nSelect by real group ID (RGID) or name.  Identical to -G.\n\n--group grplist\nSelect by effective group ID (EGID) or name.  This selects the processes whose\neffective group name or ID is in grplist.  The effective group ID describes the group\nwhose file access permissions are used by the process (see getegid(2)).  The -g option\nis often an alternative to --group.\n\np pidlist\nSelect by process ID.  Identical to -p and --pid.\n",
                    "flag": "-g"
                },
                {
                    "name": "-p",
                    "content": "Select by PID.  This selects the processes whose process ID numbers appear in pidlist.\nIdentical to p and --pid.\n\n--pid pidlist\nSelect by process ID.  Identical to -p and p.\n\n--ppid pidlist\nSelect by parent process ID.  This selects the processes with a parent process ID in\npidlist.  That is, it selects processes that are children of those listed in pidlist.\n\nq pidlist\nSelect by process ID (quick mode).  Identical to -q and --quick-pid.\n",
                    "flag": "-p"
                },
                {
                    "name": "-q",
                    "content": "Select by PID (quick mode).  This selects the processes whose process ID numbers\nappear in pidlist.  With this option ps reads the necessary info only for the pids\nlisted in the pidlist and doesn't apply additional filtering rules.  The order of pids\nis unsorted and preserved.  No additional selection options, sorting and forest type\nlistings are allowed in this mode.  Identical to q and --quick-pid.\n\n--quick-pid pidlist\nSelect by process ID (quick mode).  Identical to -q and q.\n",
                    "flag": "-q"
                },
                {
                    "name": "-s",
                    "content": "Select by session ID.  This selects the processes with a session ID specified in\nsesslist.\n\n--sid sesslist\nSelect by session ID.  Identical to -s.\n\nt ttylist\nSelect by tty.  Nearly identical to -t and --tty, but can also be used with an empty\nttylist to indicate the terminal associated with ps.  Using the T option is considered\ncleaner than using t with an empty ttylist.\n",
                    "flag": "-s"
                },
                {
                    "name": "-t",
                    "content": "Select by tty.  This selects the processes associated with the terminals given in\nttylist.  Terminals (ttys, or screens for text output) can be specified in several\nforms: /dev/ttyS1, ttyS1, S1.  A plain \"-\" may be used to select processes not\nattached to any terminal.\n\n--tty ttylist\nSelect by terminal.  Identical to -t and t.\n\nU userlist\nSelect by effective user ID (EUID) or name.  This selects the processes whose\neffective user name or ID is in userlist.  The effective user ID describes the user\nwhose file access permissions are used by the process (see geteuid(2)).  Identical to\n-u and --user.\n",
                    "flag": "-t"
                },
                {
                    "name": "-U",
                    "content": "Select by real user ID (RUID) or name.  It selects the processes whose real user name\nor ID is in the userlist list.  The real user ID identifies the user who created the\nprocess, see getuid(2).\n",
                    "flag": "-U"
                },
                {
                    "name": "-u",
                    "content": "Select by effective user ID (EUID) or name.  This selects the processes whose\neffective user name or ID is in userlist.\n\nThe effective user ID describes the user whose file access permissions are used by the\nprocess (see geteuid(2)).  Identical to U and --user.\n\n--User userlist\nSelect by real user ID (RUID) or name.  Identical to -U.\n\n--user userlist\nSelect by effective user ID (EUID) or name.  Identical to -u and U.\n",
                    "flag": "-u"
                }
            ]
        },
        "OUTPUT FORMAT CONTROL": {
            "content": "These options are used to choose the information displayed by ps.  The output may differ by\npersonality.\n",
            "subsections": [
                {
                    "name": "-c -l",
                    "content": "",
                    "flag": "-l"
                },
                {
                    "name": "--context",
                    "content": "Display security context format (for SELinux).\n",
                    "long": "--context"
                },
                {
                    "name": "-f",
                    "content": "options to add additional columns.  It also causes the command arguments to be\nprinted.  When used with -L, the NLWP (number of threads) and LWP (thread ID) columns\nwill be added.  See the c option, the format keyword args, and the format keyword\ncomm.\n",
                    "flag": "-f"
                },
                {
                    "name": "-F -f -F",
                    "content": "--format format\nuser-defined format.  Identical to -o and o.\n\nj      BSD job control format.\n",
                    "flag": "-F"
                },
                {
                    "name": "-j",
                    "content": "l      Display BSD long format.\n",
                    "flag": "-j"
                },
                {
                    "name": "-l -y",
                    "content": "",
                    "flag": "-y"
                },
                {
                    "name": "-M",
                    "content": "O format\nis preloaded o (overloaded).  The BSD O option can act like -O (user-defined output\nformat with some common fields predefined) or can be used to specify sort order.\nHeuristics are used to determine the behavior of this option.  To ensure that the\ndesired behavior is obtained (sorting or formatting), specify the option in some other\nway (e.g.  with -O or --sort).  When used as a formatting option, it is identical to\n-O, with the BSD personality.\n",
                    "flag": "-M"
                },
                {
                    "name": "-O",
                    "content": "Like -o, but preloaded with some default columns.  Identical to -o pid,format,state,\ntname,time,command or -o pid,format,tname,time,cmd, see -o below.\n\no format\nSpecify user-defined format.  Identical to -o and --format.\n",
                    "flag": "-O"
                },
                {
                    "name": "-o",
                    "content": "User-defined format.  format is a single argument in the form of a blank-separated or\ncomma-separated list, which offers a way to specify individual output columns.  The\nrecognized keywords are described in the STANDARD FORMAT SPECIFIERS section below.\nHeaders may be renamed (ps -o pid,ruser=RealUser -o comm=Command) as desired.  If all\ncolumn headers are empty (ps -o pid= -o comm=) then the header line will not be\noutput.  Column width will increase as needed for wide headers; this may be used to\nwiden up columns such as WCHAN (ps -o pid,wchan=WIDE-WCHAN-COLUMN -o comm).  Explicit\nwidth control (ps opid,wchan:42,cmd) is offered too.  The behavior of ps -o pid=X,\ncomm=Y varies with personality; output may be one column named \"X,comm=Y\" or two\ncolumns named \"X\" and \"Y\".  Use multiple -o options when in doubt.  Use the PSFORMAT\nenvironment variable to specify a default as desired; DefSysV and DefBSD are macros\nthat may be used to choose the default UNIX or BSD columns.\n\ns      Display signal format.\n\nu      Display user-oriented format.\n\nv      Display virtual memory format.\n\nX      Register format.\n",
                    "flag": "-o"
                },
                {
                    "name": "-y -l",
                    "content": "Z      Add a column of security data.  Identical to -M (for SELinux).\n",
                    "flag": "-l"
                }
            ]
        },
        "OUTPUT MODIFIERS": {
            "content": "c      Show the true command name.  This is derived from the name of the executable file,\nrather than from the argv value.  Command arguments and any modifications to them are\nthus not shown.  This option effectively turns the args format keyword into the comm\nformat keyword; it is useful with the -f format option and with the various BSD-style\nformat options, which all normally display the command arguments.  See the -f option,\nthe format keyword args, and the format keyword comm.\n\n--cols n\nSet screen width.\n\n--columns n\nSet screen width.\n",
            "subsections": [
                {
                    "name": "--cumulative",
                    "content": "Include some dead child process data (as a sum with the parent).\n\ne      Show the environment after the command.\n\nf      ASCII art process hierarchy (forest).\n",
                    "long": "--cumulative"
                },
                {
                    "name": "--forest",
                    "content": "ASCII art process tree.\n\nh      No header.  (or, one header per screen in the BSD personality).  The h option is\nproblematic.  Standard BSD ps uses this option to print a header on each page of\noutput, but older Linux ps uses this option to totally disable the header.  This\nversion of ps follows the Linux usage of not printing the header unless the BSD\npersonality has been selected, in which case it prints a header on each page of\noutput.  Regardless of the current personality, you can use the long options --headers\nand --no-headers to enable printing headers each page or disable headers entirely,\nrespectively.\n",
                    "long": "--forest"
                },
                {
                    "name": "-H",
                    "content": "",
                    "flag": "-H"
                },
                {
                    "name": "--headers",
                    "content": "Repeat header lines, one per page of output.\n\nk spec Specify sorting order.  Sorting syntax is [+|-]key[,[+|-]key[,...]].  Choose a\nmulti-letter key from the STANDARD FORMAT SPECIFIERS section.  The \"+\" is optional\nsince default direction is increasing numerical or lexicographic order.  Identical to\n--sort.\n\nExamples:\nps jaxkuid,-ppid,+pid\nps axk comm o comm,args\nps kstarttime -ef\n\n--lines n\nSet screen height.\n\nn      Numeric output for WCHAN and USER (including all types of UID and GID).\n",
                    "long": "--headers"
                },
                {
                    "name": "--no-headers",
                    "content": "Print no header line at all.  --no-heading is an alias for this option.\n\nO order\nSorting order (overloaded).  The BSD O option can act like -O (user-defined output\nformat with some common fields predefined) or can be used to specify sort order.\nHeuristics are used to determine the behavior of this option.  To ensure that the\ndesired behavior is obtained (sorting or formatting), specify the option in some other\nway (e.g.  with -O or --sort).\n\nFor sorting, obsolete BSD O option syntax is O[+|-]k1[,[+|-]k2[,...]].  It orders the\nprocesses listing according to the multilevel sort specified by the sequence of\none-letter short keys k1,k2, ... described in the OBSOLETE SORT KEYS section below.\nThe \"+\" is currently optional, merely re-iterating the default direction on a key, but\nmay help to distinguish an O sort from an O format.  The \"-\" reverses direction only\non the key it precedes.\n\n--rows n\nSet screen height.\n\nS      Sum up some information, such as CPU usage, from dead child processes into their\nparent.  This is useful for examining a system where a parent process repeatedly forks\noff short-lived children to do work.\n\n--sort spec\nSpecify sorting order.  Sorting syntax is [+|-]key[,[+|-]key[,...]].  Choose a\nmulti-letter key from the STANDARD FORMAT SPECIFIERS section.  The \"+\" is optional\nsince default direction is increasing numerical or lexicographic order.  Identical to\nk.  For example: ps jax --sort=uid,-ppid,+pid\n\nw      Wide output.  Use this option twice for unlimited width.\n",
                    "long": "--no-headers"
                },
                {
                    "name": "-w",
                    "content": "--width n\nSet screen width.\n",
                    "flag": "-w"
                }
            ]
        },
        "THREAD DISPLAY": {
            "content": "H      Show threads as if they were processes.\n",
            "subsections": [
                {
                    "name": "-L",
                    "content": "m      Show threads after processes.\n",
                    "flag": "-L"
                },
                {
                    "name": "-m",
                    "content": "",
                    "flag": "-m"
                },
                {
                    "name": "-T",
                    "content": "",
                    "flag": "-T"
                }
            ]
        },
        "OTHER INFORMATION": {
            "content": "--help section\nPrint a help message.  The section argument can be one of simple, list, output,\nthreads, misc, or all.  The argument can be shortened to one of the underlined letters\nas in: s|l|o|t|m|a.\n\n--info Print debugging info.\n\nL      List all format specifiers.\n\nV      Print the procps-ng version.\n",
            "subsections": [
                {
                    "name": "-V",
                    "content": "",
                    "flag": "-V"
                },
                {
                    "name": "--version",
                    "content": "Print the procps-ng version.\n",
                    "long": "--version"
                }
            ]
        },
        "NOTES": {
            "content": "This ps works by reading the virtual files in /proc.  This ps does not need to be setuid kmem\nor have any privileges to run.  Do not give this ps any special permissions.\n\nCPU usage is currently expressed as the percentage of time spent running during the entire\nlifetime of a process.  This is not ideal, and it does not conform to the standards that ps\notherwise conforms to.  CPU usage is unlikely to add up to exactly 100%.\n\nThe SIZE and RSS fields don't count some parts of a process including the page tables, kernel\nstack, struct threadinfo, and struct taskstruct.  This is usually at least 20 KiB of memory\nthat is always resident.  SIZE is the virtual size of the process (code+data+stack).\n\nProcesses marked <defunct> are dead processes (so-called \"zombies\") that remain because their\nparent has not destroyed them properly.  These processes will be destroyed by init(8) if the\nparent process exits.\n\nIf the length of the username is greater than the length of the display column, the username\nwill be truncated.  See the -o and -O formatting options to customize length.\n\nCommands options such as ps -aux are not recommended as it is a confusion of two different\nstandards.  According to the POSIX and UNIX standards, the above command asks to display all\nprocesses with a TTY (generally the commands users are running) plus all processes owned by a\nuser named x.  If that user doesn't exist, then ps will assume you really meant ps aux.\n",
            "subsections": []
        },
        "PROCESS FLAGS": {
            "content": "The sum of these values is displayed in the \"F\" column, which is provided by the flags output\nspecifier:\n\n1    forked but didn't exec\n4    used super-user privileges\n",
            "subsections": []
        },
        "PROCESS STATE CODES": {
            "content": "Here are the different values that the s, stat and state output specifiers (header \"STAT\" or\n\"S\") will display to describe the state of a process:\n\nD    uninterruptible sleep (usually IO)\nI    Idle kernel thread\nR    running or runnable (on run queue)\nS    interruptible sleep (waiting for an event to complete)\nT    stopped by job control signal\nt    stopped by debugger during the tracing\nW    paging (not valid since the 2.6.xx kernel)\nX    dead (should never be seen)\nZ    defunct (\"zombie\") process, terminated but not reaped by its parent\n\nFor BSD formats and when the stat keyword is used, additional characters may be displayed:\n\n<    high-priority (not nice to other users)\nN    low-priority (nice to other users)\nL    has pages locked into memory (for real-time and custom IO)\ns    is a session leader\nl    is multi-threaded (using CLONETHREAD, like NPTL pthreads do)\n+    is in the foreground process group\n",
            "subsections": []
        },
        "OBSOLETE SORT KEYS": {
            "content": "These keys are used by the BSD O option (when it is used for sorting).  The GNU --sort option\ndoesn't use these keys, but the specifiers described below in the STANDARD FORMAT SPECIFIERS\nsection.  Note that the values used in sorting are the internal values ps uses and not the\n\"cooked\" values used in some of the output format fields (e.g.  sorting on tty will sort into\ndevice number, not according to the terminal name displayed).  Pipe ps output into the\nsort(1) command if you want to sort the cooked values.\n\nKEY   LONG         DESCRIPTION\nc     cmd          simple name of executable\nC     pcpu         cpu utilization\nf     flags        flags as in long format F field\n\ng     pgrp         process group ID\nG     tpgid        controlling tty process group ID\nj     cutime       cumulative user time\nJ     cstime       cumulative system time\nk     utime        user time\nm     minflt      number of minor page faults\nM     majflt      number of major page faults\nn     cminflt     cumulative minor page faults\nN     cmajflt     cumulative major page faults\no     session      session ID\np     pid          process ID\nP     ppid         parent process ID\nr     rss          resident set size\nR     resident     resident pages\ns     size         memory size in kilobytes\nS     share        amount of shared pages\nt     tty          the device number of the controlling tty\nT     starttime   time process was started\nU     uid          user ID number\nu     user         user name\nv     vsize        total VM size in KiB\ny     priority     kernel scheduling priority\n",
            "subsections": []
        },
        "AIX FORMAT DESCRIPTORS": {
            "content": "This ps supports AIX format descriptors, which work somewhat like the formatting codes of\nprintf(1) and printf(3).  For example, the normal default output can be produced with this:\nps -eo \"%p %y %x %c\".  The NORMAL codes are described in the next section.\n\nCODE   NORMAL   HEADER\n%C     pcpu     %CPU\n%G     group    GROUP\n%P     ppid     PPID\n%U     user     USER\n%a     args     COMMAND\n%c     comm     COMMAND\n%g     rgroup   RGROUP\n%n     nice     NI\n%p     pid      PID\n%r     pgid     PGID\n%t     etime    ELAPSED\n%u     ruser    RUSER\n%x     time     TIME\n%y     tty      TTY\n%z     vsz      VSZ\n",
            "subsections": []
        },
        "STANDARD FORMAT SPECIFIERS": {
            "content": "Here are the different keywords that may be used to control the output format (e.g., with\noption -o) or to sort the selected processes with the GNU-style --sort option.\n\nFor example: ps -eo pid,user,args --sort user\n\nThis version of ps tries to recognize most of the keywords used in other implementations of\nps.\n\nThe following user-defined format specifiers may contain spaces: args, cmd, comm, command,\nfname, ucmd, ucomm, lstart, bsdstart, start.\n\nSome keywords may not be available for sorting.\n\n\nCODE        HEADER    DESCRIPTION\n\n%cpu        %CPU      cpu utilization of the process in \"##.#\" format.  Currently, it is the\nCPU time used divided by the time the process has been running\n(cputime/realtime ratio), expressed as a percentage.  It will not add\nup to 100% unless you are lucky.  (alias pcpu).\n\n%mem        %MEM      ratio of the process's resident set size  to the physical memory on the\nmachine, expressed as a percentage.  (alias pmem).\n\n\n\nargs        COMMAND   command with all its arguments as a string.  Modifications to the\narguments may be shown.  The output in this column may contain spaces.\nA process marked <defunct> is partly dead, waiting to be fully\ndestroyed by its parent.  Sometimes the process args will be\nunavailable; when this happens, ps will instead print the executable\nname in brackets.  (alias cmd, command).  See also the comm format\nkeyword, the -f option, and the c option.\nWhen specified last, this column will extend to the edge of the\ndisplay.  If ps can not determine display width, as when output is\nredirected (piped) into a file or another command, the output width is\nundefined (it may be 80, unlimited, determined by the TERM variable,\nand so on).  The COLUMNS environment variable or --cols option may be\nused to exactly determine the width in this case.  The w or -w option\nmay be also be used to adjust width.\n\nblocked     BLOCKED   mask of the blocked signals, see signal(7).  According to the width of\nthe field, a 32 or 64-bit mask in hexadecimal format is displayed.\n(alias sigblock, sigmask).\n\nbsdstart    START     time the command started.  If the process was started less than 24\nhours ago, the output format is \" HH:MM\", else it is \" Mmm:SS\" (where\nMmm is the three letters of the month).  See also lstart, start,\nstarttime, and stime.\n\nbsdtime     TIME      accumulated cpu time, user + system.  The display format is usually\n\"MMM:SS\", but can be shifted to the right if the process used more than\n999 minutes of cpu time.\n\nc           C         processor utilization.  Currently, this is the integer value of the\npercent usage over the lifetime of the process.  (see %cpu).\n\ncaught      CAUGHT    mask of the caught signals, see signal(7).  According to the width of\nthe field, a 32 or 64 bits mask in hexadecimal format is displayed.\n(alias sigcatch, sigcatch).\n\ncgname      CGNAME    display name of control groups to which the process belongs.\n\ncgroup      CGROUP    display control groups to which the process belongs.\n\nclass       CLS       scheduling class of the process.  (alias policy, cls).  Field's\npossible values are:\n\n-   not reported\nTS  SCHEDOTHER\nFF  SCHEDFIFO\nRR  SCHEDRR\nB   SCHEDBATCH\nISO SCHEDISO\nIDL SCHEDIDLE\nDLN SCHEDDEADLINE\n?   unknown value\n\ncls         CLS       scheduling class of the process.  (alias policy, cls).  Field's\npossible values are:\n\n-   not reported\nTS  SCHEDOTHER\nFF  SCHEDFIFO\nRR  SCHEDRR\nB   SCHEDBATCH\nISO SCHEDISO\nIDL SCHEDIDLE\nDLN SCHEDDEADLINE\n?   unknown value\n\ncmd         CMD       see args.  (alias args, command).\n\n\n\n\n\n\ncomm        COMMAND   command name (only the executable name).  Modifications to the command\nname will not be shown.  A process marked <defunct> is partly dead,\nwaiting to be fully destroyed by its parent.  The output in this column\nmay contain spaces.  (alias ucmd, ucomm).  See also the args format\nkeyword, the -f option, and the c option.\nWhen specified last, this column will extend to the edge of the\ndisplay.  If ps can not determine display width, as when output is\nredirected (piped) into a file or another command, the output width is\nundefined (it may be 80, unlimited, determined by the TERM variable,\nand so on).  The COLUMNS environment variable or --cols option may be\nused to exactly determine the width in this case.  The w or -w option\nmay be also be used to adjust width.\n\ncommand     COMMAND   See args.  (alias args, command).\n\ncp          CP        per-mill (tenths of a percent) CPU usage.  (see %cpu).\n\ncputime     TIME      cumulative CPU time, \"[DD-]hh:mm:ss\" format.  (alias time).\n\ncputimes    TIME      cumulative CPU time in seconds (alias times).\n\ndrs         DRS       data resident set size, the amount of physical memory devoted to other\nthan executable code.\n\negid        EGID      effective group ID number of the process as a decimal integer.  (alias\ngid).\n\negroup      EGROUP    effective group ID of the process.  This will be the textual group ID,\nif it can be obtained and the field width permits, or a decimal\nrepresentation otherwise.  (alias group).\n\neip         EIP       instruction pointer.\n\nesp         ESP       stack pointer.\n\netime       ELAPSED   elapsed time since the process was started, in the form\n[[DD-]hh:]mm:ss.\n\netimes      ELAPSED   elapsed time since the process was started, in seconds.\n\neuid        EUID      effective user ID (alias uid).\n\neuser       EUSER     effective user name.  This will be the textual user ID, if it can be\nobtained and the field width permits, or a decimal representation\notherwise.  The n option can be used to force the decimal\nrepresentation.  (alias uname, user).\n\nexe         EXE       path to the executable. Useful if path cannot be printed via cmd, comm\nor args format options.\n\nf           F         flags associated with the process, see the PROCESS FLAGS section.\n(alias flag, flags).\n\nfgid        FGID      filesystem access group ID.  (alias fsgid).\n\nfgroup      FGROUP    filesystem access group ID.  This will be the textual group ID, if it\ncan be obtained and the field width permits, or a decimal\nrepresentation otherwise.  (alias fsgroup).\n\nflag        F         see f.  (alias f, flags).\n\nflags       F         see f.  (alias f, flag).\n\nfname       COMMAND   first 8 bytes of the base name of the process's executable file.  The\noutput in this column may contain spaces.\n\nfuid        FUID      filesystem access user ID.  (alias fsuid).\n\nfuser       FUSER     filesystem access user ID.  This will be the textual user ID, if it can\nbe obtained and the field width permits, or a decimal representation\notherwise.\n\n\ngid         GID       see egid.  (alias egid).\n\ngroup       GROUP     see egroup.  (alias egroup).\n\nignored     IGNORED   mask of the ignored signals, see signal(7).  According to the width of\nthe field, a 32 or 64 bits mask in hexadecimal format is displayed.\n(alias sigignore, sigignore).\n\nipcns       IPCNS     Unique inode number describing the namespace the process belongs to.\nSee namespaces(7).\n\nlabel       LABEL     security label, most commonly used for SELinux context data.  This is\nfor the Mandatory Access Control (\"MAC\") found on high-security\nsystems.\n\nlstart      STARTED   time the command started.  See also bsdstart, start, starttime, and\nstime.\n\nlsession    SESSION   displays the login session identifier of a process, if systemd support\nhas been included.\n\nluid        LUID      displays Login ID associated with a process.\n\nlwp         LWP       light weight process (thread) ID of the dispatchable entity (alias\nspid, tid).  See tid for additional information.\n\nlxc         LXC       The name of the lxc container within which a task is running.  If a\nprocess is not running inside a container, a dash ('-') will be shown.\n\nmachine     MACHINE   displays the machine name for processes assigned to VM or container, if\nsystemd support has been included.\n\nmajflt     MAJFLT    The number of major page faults that have occurred with this process.\n\nminflt     MINFLT    The number of minor page faults that have occurred with this process.\n\nmntns       MNTNS     Unique inode number describing the namespace the process belongs to.\nSee namespaces(7).\n\nnetns       NETNS     Unique inode number describing the namespace the process belongs to.\nSee namespaces(7).\n\nni          NI        nice value.  This ranges from 19 (nicest) to -20 (not nice to others),\nsee nice(1).  (alias nice).\n\nnice        NI        see ni.(alias ni).\n\nnlwp        NLWP      number of lwps (threads) in the process.  (alias thcount).\n\nnuma        NUMA      The node associated with the most recently used processor.  A -1 means\nthat NUMA information is unavailable.\n\nnwchan      WCHAN     address of the kernel function where the process is sleeping (use wchan\nif you want the kernel function name).  Running tasks will display a\ndash ('-') in this column.\n\nouid        OWNER     displays the Unix user identifier of the owner of the session of a\nprocess, if systemd support has been included.\n\npcpu        %CPU      see %cpu.  (alias %cpu).\n\npending     PENDING   mask of the pending signals.  See signal(7).  Signals pending on the\nprocess are distinct from signals pending on individual threads.  Use\nthe m option or the -m option to see both.  According to the width of\nthe field, a 32 or 64 bits mask in hexadecimal format is displayed.\n(alias sig).\n\npgid        PGID      process group ID or, equivalently, the process ID of the process group\nleader.  (alias pgrp).\n\n\npgrp        PGRP      see pgid.  (alias pgid).\n\npid         PID       a number representing the process ID (alias tgid).\n\npidns       PIDNS     Unique inode number describing the namespace the process belongs to.\nSee namespaces(7).\n\npmem        %MEM      see %mem.  (alias %mem).\n\npolicy      POL       scheduling class of the process.  (alias class, cls).  Possible values\nare:\n\n-   not reported\nTS  SCHEDOTHER\nFF  SCHEDFIFO\nRR  SCHEDRR\nB   SCHEDBATCH\nISO SCHEDISO\nIDL SCHEDIDLE\nDLN SCHEDDEADLINE\n?   unknown value\n\nppid        PPID      parent process ID.\n\npri         PRI       priority of the process.  Higher number means lower priority.\n\npsr         PSR       processor that process is currently assigned to.\n\nrgid        RGID      real group ID.\n\nrgroup      RGROUP    real group name.  This will be the textual group ID, if it can be\nobtained and the field width permits, or a decimal representation\notherwise.\n\nrss         RSS       resident set size, the non-swapped physical memory that a task has used\n(in kilobytes).  (alias rssize, rsz).\n\nrssize      RSS       see rss.  (alias rss, rsz).\n\nrsz         RSZ       see rss.  (alias rss, rssize).\n\nrtprio      RTPRIO    realtime priority.\n\nruid        RUID      real user ID.\n\nruser       RUSER     real user ID.  This will be the textual user ID, if it can be obtained\nand the field width permits, or a decimal representation otherwise.\n\ns           S         minimal state display (one character).  See section PROCESS STATE CODES\nfor the different values.  See also stat if you want additional\ninformation displayed.  (alias state).\n\nsched       SCH       scheduling policy of the process.  The policies SCHEDOTHER\n(SCHEDNORMAL), SCHEDFIFO, SCHEDRR, SCHEDBATCH, SCHEDISO,\nSCHEDIDLE and SCHEDDEADLINE are respectively displayed as 0, 1, 2, 3,\n4, 5 and 6.\n\nseat        SEAT      displays the identifier associated with all hardware devices assigned\nto a specific workplace, if systemd support has been included.\n\nsess        SESS      session ID or, equivalently, the process ID of the session leader.\n(alias session, sid).\n\nsgip       P         processor that the process is currently executing on.  Displays \"*\" if\nthe process is not currently running or runnable.\n\nsgid        SGID      saved group ID.  (alias svgid).\n\nsgroup      SGROUP    saved group name.  This will be the textual group ID, if it can be\nobtained and the field width permits, or a decimal representation\notherwise.\n\n\nsid         SID       see sess.  (alias sess, session).\n\nsig         PENDING   see pending.  (alias pending, sigpend).\n\nsigcatch    CAUGHT    see caught.  (alias caught, sigcatch).\n\nsigignore   IGNORED   see ignored.  (alias ignored, sigignore).\n\nsigmask     BLOCKED   see blocked.  (alias blocked, sigblock).\n\nsize        SIZE      approximate amount of swap space that would be required if the process\nwere to dirty all writable pages and then be swapped out.  This number\nis very rough!\n\nslice       SLICE     displays the slice unit which a process belongs to, if systemd support\nhas been included.\n\nspid        SPID      see lwp.  (alias lwp, tid).\n\nstackp      STACKP    address of the bottom (start) of stack for the process.\n\nstart       STARTED   time the command started.  If the process was started less than 24\nhours ago, the output format is \"HH:MM:SS\", else it is \"  Mmm dd\"\n(where Mmm is a three-letter month name).  See also lstart, bsdstart,\nstarttime, and stime.\n\nstarttime  START     starting time or date of the process.  Only the year will be displayed\nif the process was not started the same year ps was invoked, or \"MmmDD\"\nif it was not started the same day, or \"HH:MM\" otherwise.  See also\nbsdstart, start, lstart, and stime.\n\nstat        STAT      multi-character process state.  See section PROCESS STATE CODES for the\ndifferent values meaning.  See also s and state if you just want the\nfirst character displayed.\n\nstate       S         see s. (alias s).\n\nstime       STIME     see starttime. (alias starttime).\n\nsuid        SUID      saved user ID.  (alias svuid).\n\nsupgid      SUPGID    group ids of supplementary groups, if any.  See getgroups(2).\n\nsupgrp      SUPGRP    group names of supplementary groups, if any.  See getgroups(2).\n\nsuser       SUSER     saved user name.  This will be the textual user ID, if it can be\nobtained and the field width permits, or a decimal representation\notherwise.  (alias svuser).\n\nsvgid       SVGID     see sgid.  (alias sgid).\n\nsvuid       SVUID     see suid.  (alias suid).\n\nsz          SZ        size in physical pages of the core image of the process.  This includes\ntext, data, and stack space.  Device mappings are currently excluded;\nthis is subject to change.  See vsz and rss.\n\ntgid        TGID      a number representing the thread group to which a task belongs (alias\npid).  It is the process ID of the thread group leader.\n\nthcount     THCNT     see nlwp.  (alias nlwp).  number of kernel threads owned by the\nprocess.\n\ntid         TID       the unique number representing a dispatchable entity (alias lwp, spid).\nThis value may also appear as: a process ID (pid); a process group ID\n(pgrp); a session ID for the session leader (sid); a thread group ID\nfor the thread group leader (tgid); and a tty process group ID for the\nprocess group leader (tpgid).\n\ntime        TIME      cumulative CPU time, \"[DD-]HH:MM:SS\" format.  (alias cputime).\n\n\ntimes       TIME      cumulative CPU time in seconds (alias cputimes).\n\ntname       TTY       controlling tty (terminal).  (alias tt, tty).\n\ntpgid       TPGID     ID of the foreground process group on the tty (terminal) that the\nprocess is connected to, or -1 if the process is not connected to a\ntty.\n\ntrs         TRS       text resident set size, the amount of physical memory devoted to\nexecutable code.\n\ntt          TT        controlling tty (terminal).  (alias tname, tty).\n\ntty         TT        controlling tty (terminal).  (alias tname, tt).\n\nucmd        CMD       see comm.  (alias comm, ucomm).\n\nucomm       COMMAND   see comm.  (alias comm, ucmd).\n\nuid         UID       see euid.  (alias euid).\n\nuname       USER      see euser.  (alias euser, user).\n\nunit        UNIT      displays unit which a process belongs to, if systemd support has been\nincluded.\n\nuser        USER      see euser.  (alias euser, uname).\n\nuserns      USERNS    Unique inode number describing the namespace the process belongs to.\nSee namespaces(7).\n\nutsns       UTSNS     Unique inode number describing the namespace the process belongs to.\nSee namespaces(7).\n\nuunit       UUNIT     displays user unit which a process belongs to, if systemd support has\nbeen included.\n\nvsize       VSZ       see vsz.  (alias vsz).\n\nvsz         VSZ       virtual memory size of the process in KiB (1024-byte units).  Device\nmappings are currently excluded; this is subject to change.  (alias\nvsize).\n\nwchan       WCHAN     name of the kernel function in which the process is sleeping, a \"-\" if\nthe process is running, or a \"*\" if the process is multi-threaded and\nps is not displaying threads.\n\n",
            "subsections": []
        },
        "ENVIRONMENT VARIABLES": {
            "content": "The following environment variables could affect ps:\n\nCOLUMNS\nOverride default display width.\n\nLINES\nOverride default display height.\n\nPSPERSONALITY\nSet to one of posix, old, linux, bsd, sun, digital... (see section PERSONALITY below).\n\nCMDENV\nSet to one of posix, old, linux, bsd, sun, digital... (see section PERSONALITY below).\n\nIWANTABROKENPS\nForce obsolete command line interpretation.\n\nLCTIME\nDate format.\n\nPSCOLORS\nNot currently supported.\n\nPSFORMAT\nDefault output format override.  You may set this to a format string of the type used for\nthe -o option.  The DefSysV and DefBSD values are particularly useful.\n\nPOSIXLYCORRECT\nDon't find excuses to ignore bad \"features\".\n\nPOSIX2\nWhen set to \"on\", acts as POSIXLYCORRECT.\n\nUNIX95\nDon't find excuses to ignore bad \"features\".\n\nXPG\nCancel CMDENV=irix non-standard behavior.\n\nIn general, it is a bad idea to set these variables.  The one exception is CMDENV or\nPSPERSONALITY, which could be set to Linux for normal systems.  Without that setting, ps\nfollows the useless and bad parts of the Unix98 standard.\n",
            "subsections": []
        },
        "PERSONALITY": {
            "content": "390        like the OS/390 OpenEdition ps\naix        like AIX ps\nbsd        like FreeBSD ps (totally non-standard)\ncompaq     like Digital Unix ps\ndebian     like the old Debian ps\ndigital    like Tru64 (was Digital Unix, was OSF/1) ps\ngnu        like the old Debian ps\nhp         like HP-UX ps\nhpux       like HP-UX ps\nirix       like Irix ps\nlinux      * recommended *\nold        like the original Linux ps (totally non-standard)\nos390      like OS/390 Open Edition ps\nposix      standard\ns390       like OS/390 Open Edition ps\nsco        like SCO ps\nsgi        like Irix ps\nsolaris2   like Solaris 2+ (SunOS 5) ps\nsunos4     like SunOS 4 (Solaris 1) ps (totally non-standard)\nsvr4       standard\nsysv       standard\ntru64      like Tru64 (was Digital Unix, was OSF/1) ps\nunix       standard\nunix95     standard\nunix98     standard\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pgrep(1), pstree(1), top(1), proc(5).\n",
            "subsections": []
        },
        "STANDARDS": {
            "content": "This ps conforms to:\n\n1   Version 2 of the Single Unix Specification\n2   The Open Group Technical Standard Base Specifications, Issue 6\n3   IEEE Std 1003.1, 2004 Edition\n4   X/Open System Interfaces Extension [UP XSI]\n5   ISO/IEC 9945:2003\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "ps was originally written by Branko Lankester ⟨lankeste@fwi.uva.nl⟩.  Michael K. Johnson\n⟨johnsonm@redhat.com⟩ re-wrote it significantly to use the proc filesystem, changing a few\nthings in the process.  Michael Shields ⟨mjshield@nyx.cs.du.edu⟩ added the pid-list feature.\nCharles Blake ⟨cblake@bbn.com⟩ added multi-level sorting, the dirent-style library, the de‐\nvice name-to-number mmaped database, the approximate binary search directly on System.map,\nand many code and documentation cleanups.  David Mossberger-Tang wrote the generic BFD sup‐\nport for psupdate.  Albert Cahalan ⟨albert@users.sf.net⟩ rewrote ps for full Unix98 and BSD\nsupport, along with some ugly hacks for obsolete and foreign syntax.\n\nPlease send bug reports to ⟨procps@freelists.org⟩.  No subscription is required or suggested.\n\n\n\nprocps-ng                                    2020-06-04                                        PS(1)",
            "subsections": []
        }
    },
    "summary": "ps - report a snapshot of the current processes.",
    "flags": [],
    "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="
    ],
    "see_also": [
        {
            "name": "pgrep",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pgrep/1/json"
        },
        {
            "name": "pstree",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pstree/1/json"
        },
        {
            "name": "top",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/top/1/json"
        },
        {
            "name": "proc",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/proc/5/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Information about running processes.",
        "examples": [
            {
                "description": "List all running processes",
                "command": "ps aux"
            },
            {
                "description": "List all running processes including the full command string",
                "command": "ps auxww"
            },
            {
                "description": "Search for a process that matches a string (the brackets will prevent `grep` from matching itself)",
                "command": "ps aux | grep {{s]tring}}"
            },
            {
                "description": "List all processes of the current user in extra full format",
                "command": "ps {{-u|--user}} $(id {{-u|--user}}) -F"
            },
            {
                "description": "List all processes of the current user as a tree",
                "command": "ps {{-u|--user}} $(id {{-u|--user}}) f"
            },
            {
                "description": "Get the parent PID of a process",
                "command": "ps {{-o|--format}} ppid= {{-p|--pid}} {{pid}}"
            },
            {
                "description": "Sort processes by memory consumption",
                "command": "ps --sort size"
            }
        ]
    }
}