fbpx
Wikipedia

ps (Unix)

In most Unix and Unix-like operating systems, the ps program (short for "process status") displays the currently-running processes. A related Unix utility named top provides a real-time view of the running processes.

ps
The ps command
Original author(s)AT&T Bell Laboratories
Developer(s)Various open-source and commercial developers
Initial releaseFebruary 1973; 51 years ago (1973-02)
Written inC
Operating systemUnix, Unix-like, Plan 9, Inferno, KolibriOS, IBM i
PlatformCross-platform
TypeCommand
LicensePlan 9: MIT License

Implementations edit

KolibriOS includes an implementation of the ps command.[1] The ps command has also been ported to the IBM i operating system.[2] In Windows PowerShell, ps is a predefined command alias for the Get-Process cmdlet, which essentially serves the same purpose.

Examples edit

# ps  PID TTY TIME CMD  7431 pts/0 00:00:00 su  7434 pts/0 00:00:00 bash 18585 pts/0 00:00:00 ps 

Users can pipeline ps with other commands, such as less to view the process status output one page at a time:

$ ps -A | less 

Users can also utilize the ps command in conjunction with the grep command (see the pgrep and pkill commands) to find information about a single process, such as its id:

$ # Trying to find the PID of `firefox-bin` which is 2701 $ ps -A | grep firefox-bin 2701 ? 22:16:04 firefox-bin 

The use of pgrep simplifies the syntax and avoids potential race conditions:

$ pgrep -l firefox-bin 2701 firefox-bin 

To see every process running as root in user format:

# ps -U root -u USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND root 1 0.0 0.0 9436 128 - ILs Sun00AM 0:00.12 /sbin/init -- 

Header line edit

Column Header Contents
%CPU How much of the CPU the process is using
%MEM How much memory the process is using
ADDR Memory address of the process
C or CP CPU usage and scheduling information
COMMAND* Name of the process, including arguments, if any
NI nice value
F Flags
PID Process ID number
PPID ID number of the process's parent process
PRI Priority of the process
RSS Resident set size
S or STAT Process status code
START or STIME Time when the process started
VSZ Virtual memory usage
TIME The amount of CPU time used by the process
TT or TTY Terminal associated with the process
UID or USER Username of the process's owner
WCHAN Memory address of the event the process is waiting for

* = Often abbreviated

Options edit

ps has many options. On operating systems that support the SUS and POSIX standards, ps commonly runs with the options -ef, where "-e" selects every process and "-f" chooses the "full" output format. Another common option on these systems is -l, which specifies the "long" output format.

Most systems derived from BSD fail to accept the SUS and POSIX standard options because of historical conflicts. (For example, the "e" or "-e" option will display environment variables.) On such systems, ps commonly runs with the non-standard options aux, where "a" lists all processes on a terminal, including those of other users, "x" lists all processes without controlling terminals and "u" adds a column for the controlling user for each process. For maximum compatibility, there is no "-" in front of the "aux". "ps auxww" provides complete information about the process, including all parameters.

See also edit

References edit

  1. ^ "Shell - KolibriOS wiki".
  2. ^ IBM. "IBM System i Version 7.2 Programming Qshell" (PDF). IBM. Retrieved 2020-09-05.

Further reading edit

  • McElhearn, Kirk (2006). The Mac OS X Command Line: Unix Under the Hood. John Wiley & Sons. ISBN 978-0470113851.
  • Shotts (Jr), William E. (2012). The Linux Command Line: A Complete Introduction. No Starch Press. pp. 96–98. ISBN 9781593273897. Retrieved 16 October 2017.

External links edit

unix, this, article, written, like, manual, guide, please, help, rewrite, this, article, remove, advice, instruction, april, 2020, this, article, needs, additional, citations, verification, please, help, improve, this, article, adding, citations, reliable, sou. This article is written like a manual or guide Please help rewrite this article and remove advice or instruction April 2020 This article needs additional citations for verification Please help improve this article by adding citations to reliable sources Unsourced material may be challenged and removed Find sources Ps Unix news newspapers books scholar JSTOR October 2017 Learn how and when to remove this template message In most Unix and Unix like operating systems the ps program short for process status displays the currently running processes A related Unix utility named a href Top software html title Top software top a provides a real time view of the running processes psThe ps commandOriginal author s AT amp T Bell LaboratoriesDeveloper s Various open source and commercial developersInitial releaseFebruary 1973 51 years ago 1973 02 Written inCOperating systemUnix Unix like Plan 9 Inferno KolibriOS IBM iPlatformCross platformTypeCommandLicensePlan 9 MIT License Contents 1 Implementations 2 Examples 3 Header line 4 Options 5 See also 6 References 7 Further reading 8 External linksImplementations editKolibriOS includes an implementation of the ps command 1 The ps command has also been ported to the IBM i operating system 2 In Windows PowerShell ps is a predefined command alias for the Get Process cmdlet which essentially serves the same purpose Examples edit ps PID TTY TIME CMD 7431 pts 0 00 00 00 su 7434 pts 0 00 00 00 bash 18585 pts 0 00 00 00 ps Users can pipeline ps with other commands such as less to view the process status output one page at a time ps A lessUsers can also utilize the ps command in conjunction with the a href Grep html title Grep grep a command see the a href Pgrep html title Pgrep pgrep a and a href Pkill html title Pkill pkill a commands to find information about a single process such as its id Trying to find the PID of firefox bin which is 2701 ps A grep firefox bin 2701 22 16 04 firefox bin The use of a href Pgrep html title Pgrep pgrep a simplifies the syntax and avoids potential race conditions pgrep l firefox bin 2701 firefox bin To see every process running as root in user format ps U root u USER PID CPU MEM VSZ RSS TT STAT STARTED TIME COMMAND root 1 0 0 0 0 9436 128 ILs Sun00AM 0 00 12 sbin init Header line editColumn Header Contents CPU How much of the CPU the process is using MEM How much memory the process is usingADDR Memory address of the processC or CP CPU usage and scheduling informationCOMMAND Name of the process including arguments if anyNI nice valueF FlagsPID Process ID numberPPID ID number of the process s parent processPRI Priority of the processRSS Resident set sizeS or STAT Process status codeSTART or STIME Time when the process startedVSZ Virtual memory usageTIME The amount of CPU time used by the processTT or TTY Terminal associated with the processUID or USER Username of the process s ownerWCHAN Memory address of the event the process is waiting for Often abbreviatedOptions editps has many options On operating systems that support the SUS and POSIX standards ps commonly runs with the options ef where e selects every process and f chooses the full output format Another common option on these systems is l which specifies the long output format Most systems derived from BSD fail to accept the SUS and POSIX standard options because of historical conflicts For example the e or e option will display environment variables On such systems ps commonly runs with the non standard options aux where a lists all processes on a terminal including those of other users x lists all processes without controlling terminals and u adds a column for the controlling user for each process For maximum compatibility there is no in front of the aux ps auxww provides complete information about the process including all parameters See also editTask manager kill command List of Unix commands nmon a system monitor tool for the AIX and Linux operating systems pgrep pstree Unix top Unix lsofReferences edit Shell KolibriOS wiki IBM IBM System i Version 7 2 Programming Qshell PDF IBM Retrieved 2020 09 05 Further reading editMcElhearn Kirk 2006 The Mac OS X Command Line Unix Under the Hood John Wiley amp Sons ISBN 978 0470113851 Shotts Jr William E 2012 The Linux Command Line A Complete Introduction No Starch Press pp 96 98 ISBN 9781593273897 Retrieved 16 October 2017 External links edit nbsp The Wikibook Guide to Unix has a page on the topic of Commands ps Shell and Utilities Reference The Single UNIX Specification Version 4 from The Open Group ps 1 Plan 9 Programmer s Manual Volume 1 ps 1 Inferno General commands Manual Show all running processes in Linux using ps command In Unix what do the output fields of the ps command mean Retrieved from https en wikipedia org w index php title Ps Unix amp oldid 1146841722, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.