[ TechDocsCove ]  TechDocsCove en   ↩︎

# Understanding `ps` Command in Linux

linux   shell   system administration  

translations: [ es/Español ] · [ fr/Français ] · [ de/Deutsch ]


Table of contents


The ps command in Linux is a versatile tool used to gather information about processes running on a system. It stands for “process status” and offers various options to view and manage processes.

Basic Usage

The basic usage of ps involves displaying a snapshot of active processes. Here’s a simple command:

ps

This command provides a list of processes initiated by the current user in the current terminal session. However, it might not display all processes on the system.

Useful Options

Display All Processes

To display all processes running on the system, including those owned by other users, use the -e or -A option:

ps -e

or

ps -A

Detailed Information

For more detailed information about processes, including the process ID (PID), terminal associated with the process, CPU and memory usage, use the -l option:

ps -l

Tree View

View processes in a hierarchical/tree format, indicating parent-child relationships, using the --forest option:

ps --forest

Continuous Monitoring

For continuous updates displaying running processes every second, combine the watch command with ps. For instance:

watch -n 1 'ps aux'

This command will update the displayed processes every second.



Created on: Dec 29, 2023


Email shareIcon for sharing via email    Reddit shareIcon for sharing via Reddit    X shareIcon for sharing via X    Telegram shareIcon for sharing via Telegram    WhatsApp shareIcon for sharing via WhatsApp    Facebook shareIcon for sharing via Facebook    LinkedIn shareIcon for sharing via LinkedIn



Discover More within this Subject: