ps command in Linux is utilized for reporting a snapshot of the current
processes. It provides information about the running processes, their PIDs (
Process ID), the user who owns the process, CPU and memory usage, and other
The basic syntax for the
ps command is as follows:
Here are some commonly used options with the
|Display the help message and exit.
|Show processes for all users.
|Display user-oriented format.
|Include processes with no controlling terminal.
|Display the environment as well.
|Display full format listing with extra full format.
|Display ASCII art process hierarchy (tree view).
Listing All Processes
a option displays processes from all users,
u provides user-centric
x displays processes without a controlling terminal. This
combination reveals all currently running processes.
Displaying Process in a Tree Structure
--forest option shows the process hierarchy in a tree structure,
illustrating the parent-child relationships between processes.
Listing Specific User’s Processes
ps -u [username]
[username] with the actual username for which you want to list the
Displaying Processes with Full Format Listing
This command gives a detailed view of all processes in extra full format, providing extensive information about each process.
How to Use
ps Command Effectively
By combining various options, you can tailor the
ps command output to display
specific information that suits your needs. For instance, if you want to view
the processes of a specific user in a user-oriented format, you can combine
-u option with the user's name:
ps -u username
If you want to get more detailed information about the user's processes, you
might use the
f option, showing the hierarchical relationship between
ps -fu username
ps command in Linux is a versatile and powerful tool for monitoring
pr ocesses. By learning and combining different options, you can get detailed
insights into the process status, the user who owns them, resource usage, and
much more. Whether you are a system administrator or an everyday user,
understanding how to use the
ps command effectively can help you manage and
troubleshoot running processes with ease.
What Can You Do Next 🙏😊
If you liked the article, consider subscribing to Cloudaffle, my YouTube Channel, where I keep posting in-depth tutorials and all edutainment stuff for software developers.