Junior
How to view the list of running processes in Linux?
sobes.tech AI
Answer from AI
There are several main methods:
-
Using the
pscommand: Allows viewing current processes.// Show all processes for all users in BSD format ps aux // Show processes in a tree format ps axjf // Show only processes of the current user in a readable format ps -efCommon fields:
Field Description UIDUser identifier PIDProcess identifier PPIDParent process identifier TTYTerminal associated with the process CMDCommand that started the process -
Using the
topcommand: An interactive tool that displays processes in real-time, sorted by CPU usage (default).// Run top top // Run top with updates every 2 seconds top -d 2 -
Using the
htopcommand: An improved version oftopwith a more user-friendly interface and additional features (requires installation).// Run htop htop
The choice of command depends on the required information and user preferences. For quick static viewing, ps is often used; for interactive real-time monitoring, top or htop are preferred.