Skip to main content
Understanding how to manage processes is fundamental for any Linux administrator. A process is simply a running instance of a program, from short-lived commands like ls to long-running services.

1. Launching a Process

For example, running:
creates a short-lived ls process that exits once the directory contents are shown.

2. Inspecting Processes with ps

The ps command lists active processes. It has two distinct option styles: To view all processes in a user-friendly layout, combine a (others’ processes), x (no controlling terminal), and u (user format):

2.1 Exploring ps Options

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, explaining the command's usage and options.
Common invocations from the manual:
  • Full format
  • Process tree
  • Thread details

2.2 Understanding ps aux Columns

Kernel threads run in kernel space and appear in square brackets, e.g., [kworker/0:1].

3. Real-Time Monitoring with top

To watch processes live:
  • Use arrow keys or Page Up/Page Down to navigate.
  • Press Q to quit.

4. Targeted Process Listings


5. Managing Process Priority (Niceness)

Niceness spans -20 (highest priority) to 19 (lowest). Lower niceness → higher scheduling priority.

5.1 Launching with nice

5.2 Viewing Niceness

The NI column shows the niceness value.

5.3 Changing with renice


6. Signals and kill

Linux uses signals to control processes:
You can omit the SIG prefix:
Using SIGKILL (kill -9) does not allow cleanup and may leave resources in an inconsistent state. Use SIGTERM first.

Example: Restarting sshd


7. Shell Job Control


8. Open Files with lsof

  • List files opened by a PID:
  • Find which process holds a file:
Use sudo when required to avoid permission denied errors.

That concludes our guide on creating, monitoring, and killing processes in Linux. Practice these commands in a lab environment to master process management.

Watch Video