PS Commands Cheatsheet — Essential Reference
The `ps` command is used to display information about currently running processes. It provides a snapshot of the current processes, including their IDs, status, and resource usage.
RECOMMENDED
Master PS with Top Reference Books
Level up your DevOps skills. Find the best guide books and cheatsheet references for your engineering stack.
Commands
| Command | Description | Example |
|---|---|---|
ps |
Display processes for the current terminal. | ps |
ps aux |
Display all processes running on the system, including those of other users, in a user-oriented format. | ps aux |
ps -ef |
Display all processes in a full listing format, showing process ID, parent process ID, CPU usage, start time, and command. | ps -ef |
ps -eF |
Display all processes in an extra full format, including more details like scheduling class and priority. | ps -eF |
ps -o pid,ppid,user,cmd |
Display processes with custom output format, showing specific columns like PID, PPID, user, and command. | ps -o pid,ppid,user,cmd |
ps -p <PID> |
Display information about a specific process by its Process ID (PID). | ps -p 12345 |
ps -U <username> |
Display processes owned by a specific user. | ps -U root |
ps aux | grep <process_name> |
Find a specific process by name using `grep` to filter the output of `ps aux`. | ps aux | grep nginx |
Pro Tips
- Combine `ps` with `grep` to quickly find specific processes or filter output.
- Use `watch 'ps aux'` to continuously monitor processes in real-time.
- Understand the different output formats (`aux`, `-ef`, `-o`) to get the information you need efficiently.
Frequently Asked Questions
What is ps used for?
The `ps` command is primarily used to view a snapshot of the currently running processes on a Unix-like operating system. It helps in monitoring system activity, identifying resource-intensive processes, and troubleshooting.
How do I install ps?
`ps` is a standard utility on all Unix-like operating systems (Linux, macOS, BSD) and is typically pre-installed as part of the `procps-ng` package (on Linux) or the base system. You generally do not need to install it separately.