ls to long-running services.
1. Launching a Process
For example, running: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

- 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
Qto 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
5.3 Changing with renice
6. Signals and kill
Linux uses signals to control processes:
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.
Links and References
- ps(1) — Linux Manual Page
- top(1) — Linux Manual Page
- kill(1) — Linux Manual Page
- lsof(8) — Linux Manual Page