Linux Terminal Command: ps
The ps command is an essential tool in Process & Job Control. In this tutorial, we will explore what ps does, look at everyday examples, and cover advanced options to supercharge your command-line workflow.
Concept & Explanation
The ps command provides static process tracking data. It shows process IDs (PID), memory usage, CPU status, and command names.
Common Options & Syntax
ps [options] [arguments]
Here are the most common flags used with ps:
- Simple Usage: Basic default commands.
- Detailed View: Shows diagnostic information.
- Advanced Actions: Can chain parameters for scripting.
1. Interactive Example (Simple)
Here is how most people run the command:
# Example
ps
What it does: Lists active processes running in the current terminal session.
2. Power-User Example (Advanced)
For scripting and advanced diagnostics, use this configuration:
# Advanced
ps aux | grep nginx
What it does: Lists every running process on the system (a for all users, u for user details, x for processes not attached to terminal) and filters for Nginx.
⚙️ Warning & Common Pitfalls
[!WARNING]
psoutputs a static snapshot. For real-time interactive process monitoring, usetoporhtop.
🔗 Related Commands
Here are some related posts on cli_tty1 you might want to check out: