Sobes.tech
Middle+

How to view running processes in Linux? How to check CPU load?

sobes.tech AI

Answer from AI

To view running processes in Linux, you can use the ps command or the interactive utility top.

  • ps aux — displays a list of all processes with detailed information.
  • top — an interactive process monitor with real-time updates.
  • htop — a more user-friendly version of top (if installed).

To check CPU load:

  • In top, the CPU load percentage is displayed at the top.
  • The uptime command shows the average load over 1, 5, and 15 minutes.
  • mpstat (from the sysstat package) provides detailed CPU statistics.

Example:

ps aux | grep python  # view processes with python

top  # start process monitoring

uptime  # view average load

mpstat 1 3  # display CPU statistics with 1-second interval, 3 times

These tools help monitor system status and identify resource-consuming processes.