
{{ $('Map tags to IDs').item.json.title }}
How to Use ps aux for Process Info
In Linux, monitoring and managing processes is a crucial aspect of system administration. The ps
command, particularly when used with the aux
options, provides comprehensive information about the current running processes. This tutorial will guide you through using ps aux
effectively to view process information.
1. Understanding the ps Command
The ps
command displays information about active processes on the system. When used with aux
, it provides detailed information about every process running:
ps aux
2. Interpreting the Output
The output of ps aux
typically contains the following columns:
- USER: The user who owns the process.
- PID: The process ID.
- CPU: The percentage of CPU utilized by the process.
- MEM: The percentage of memory used by the process.
- VSZ: Virtual memory size of the process.
- RSS: Resident set size, the non-swapped physical memory used by the process.
- TTY: The terminal associated with the process.
- STAT: The process state (e.g., running, sleeping).
- START: Start time of the process.
- TIME: Total CPU time the process has used.
- COMMAND: The command that initiated the process.
Here’s an example of the output:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 169472 10424 ? Ss Nov12 0:02 /sbin/init
3. Filtering Process Information
You can filter the output to find specific processes using tools like grep
. For example, to find processes related to nginx
:
ps aux | grep nginx
This command shows all processes containing nginx
in their command line.
4. Sorting Process Output
To sort the output by memory or CPU usage, you can combine ps
with the sort
command:
ps aux --sort=-%mem
This command sorts processes by memory usage in descending order.
5. Conclusion
By following this tutorial, you have learned how to use the ps aux
command to monitor and manage processes in Linux. Understanding process information is essential for troubleshooting and system administration. Explore further options with ps
and integrate them into your regular system management practices!