Skip to main content
When you start any application, Linux creates a process that runs until completion or termination. Understanding how to monitor and control these processes is essential for effective system administration and performance tuning.

Short-Lived vs. Long-Lived Processes

Short-Lived Processes

Commands like ls spawn a process that exits immediately after running:

Long-Lived Processes

Daemons such as sshd or long-running services remain active until explicitly stopped. To inspect active processes, the ps command is your first stop.

Inspecting Processes with ps

ps provides a snapshot of processes. It supports two option syntaxes:
Use man ps to explore all options and compare Unix vs. BSD syntax.

Common ps Usage

  • Show processes in the current terminal:
  • List all system processes in user-oriented format:
The mnemonic aux (a: all with terminal, u: user format, x: include daemons) helps recall this combination.
The image shows a terminal window displaying the manual page for the ps command, which reports a snapshot of current processes. It includes sections like NAME, SYNOPSIS, and DESCRIPTION.
Excerpt from man ps:

Real-Time Monitoring with top

For continuous updates:
  • Use Up/Down arrows or Page Up/Page Down to scroll.
  • Press q to exit.

Filtering Processes


Adjusting Niceness (Priority)

Process priority (nice value) ranges from –20 (highest) to +19 (lowest).
  • Launch with niceness 11:
  • View niceness:
  • Change niceness of an existing PID:

Parent/Child Process Trees

Display processes as a hierarchy:
The image shows a terminal window displaying a list of running processes on a CentOS system, including details like user, PID, CPU and memory usage, and command paths.

Sending Signals

Linux signals control process behavior. Common signals include: List all signals:
Examples:
Killing your login shell (e.g., bash) will close your terminal or SSH session.

Job Control: Background & Foreground

  • Ctrl+C: Interrupt
  • Ctrl+Z: Suspend
  • Start in background: sleep 300 &
  • List jobs: jobs
  • Bring to foreground: fg %1
  • Send to background: bg %1

Inspecting Open Files with lsof

List files held by a process:
View root-owned processes:
Find processes using a specific file:

Watch Video