How to view running processes in Linux?

In Linux system, you can use the following command to view the running processes:

  1. The ps command is used to view the list of currently running processes.
  2. ps aux: Display all processes of all users.
  3. ps -ef: display the detailed information of all processes.
  4. Display the process tree structure using ps -e –forest.
  5. The top command: dynamically displays information about the processes currently running in the system.
  6. After entering the top command in the terminal, you can press Shift + P to sort by CPU usage and Shift + M to sort by memory usage.
  7. htop command: similar to the top command, but offers more interactive features.
  8. You need to install htop first. Use the command sudo apt-get install htop to install it.
  9. pgrep command: used to find the PID of a process based on its name or other conditions.
  10. pgrep : find the PID of a process based on its name.
  11. pgrep -u : Search for the process ID based on the username.
  12. The pidof command is used to find the PID of a process based on its name.
  13. Find the PID of a process based on its name using “pidof”.

The above command can be further refined and sorted based on your needs using additional options.

bannerAds