In most 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 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
$ # Trying to find the PID of `firefox-bin` which is 2701 $ ps -A | grep firefox-bin 2701 ? 22:16:04 firefox-bin
and the easier and non-racy version with pgrep:
$ 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 --
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 Real memory usage S or STAT Process status code START or STIME Time when the process started SZ Virtual memory usage TIME Total CPU usage 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
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 cause the display of 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. Note that, for maximum compatibility when using this syntax, there is no "-" in front of the "aux". Also you can add 'ww' after aux, like "ps auxww" for complete information about the process including all parameters.
- Task manager
- List of Unix programs
nmon— a system monitor tool for the AIX and Linux operating systems.
- The Single UNIX® Specification, Issue 7 from The Open Group – Commands & Utilities Reference,
- Show all running processes in Linux using ps command
- Linux User Commands Manual : report a snapshot of the current processes –
- In Unix, what do the output fields of the ps command mean?