ps
ProcessesFundamentals In simulator In real LinuxReport a snapshot of current processes
Name: ps = process status
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
ps shows a snapshot of current processes (it doesn't refresh). It accepts two option styles: Unix (with a dash, ps -ef) and BSD (without, ps aux), with slightly different columns.
Common columns: PID, PPID (parent), USER, %CPU, %MEM, STAT (R running, S sleeping, Z zombie …) and CMD.
Syntax
ps [OPTION]...Common options
| aux | BSD style: every process with CPU and memory |
| -e / -A | Select all processes |
| -f | Full format: user, parent PID … |
| -u USER | Only a user's processes |
| -p PID | Only these process IDs (comma-separated) |
| -C NAME | Only processes called NAME |
| -o FORMAT | Choose the columns: ps -eo pid,user,%cpu,%mem,cmd |
| --sort KEY | Sort; - means largest first: ps aux --sort=-%mem |
| --forest | Show parents and children as a tree |
| -L | Show threads |