How to Use ps Command to List Processes in Linux


 Introduction


While top provides live monitoring, the ps command gives a snapshot of processes. It's very useful for scripting and logging.


Step 1: Show All Running Processes


ps -ef


➡️ Lists all processes in full format.


Step 2: Show Processes for a Specific User


ps -u username


➡️ Replace username with the actual Linux user.


Step 3: Find a Specific Process


ps -ef | grep httpd


➡️ Searches for processes related to Apache (httpd).


Conclusion

The ps command is flexible for viewing process details and is often used in scripts.

Comments