1. View Running Processes
Loading...All processes:
Loading...Process tree:
Loading...Live process view:
Loading...2. Find a Process
Loading...Example:
Loading...3. Process ID (PID)
Every running process has a PID.
Loading...Example:
Loading...4. Start a Process in Background
A command normally runs in the foreground, meaning the terminal waits until it finishes.
Adding
& runs the command in the background, so you can continue using the terminal.Loading...Example:
Loading...Here,
sleep 100 waits for 100 seconds, but because of &, it runs in the background and the terminal is immediately available for other commands.Check background jobs:
Loading...Example output:
Loading...[1]→ Job ID
Running→ Current status
sleep 100→ Background command
Important:
& runs the process in the background of the current shell. It is still associated with that terminal session.- To see the Pid of running job :
- Use this :
jobs -l
5. Move Process to Background
Stop a running process temporarily:
Loading...Continue it in background:
Loading...Ctrl+Z and bg — Pausing and Resuming a Job
- A simple example to demonstrate how a running process can be paused with
Ctrl+Zand resumed in the background usingbg.
6. Bring Process to Foreground
Loading...Specific job:
Loading...7. Kill a Process
Using PID:
Loading...Force kill:
Loading...Faster way for all stopped jobs
Loading...Using process name:
Loading...kill %1→ specific job
kill 4674→ specific process/PID
pkill a→ all matching processes nameda
8. Check Process Status
Loading...Example:
Loading...9. Run Process Even After Terminal Closes
Loading...Example:
Loading...10. Useful Shortcuts
Command | Purpose |
ps aux | List all processes |
top | Live process monitoring |
pgrep | Find PID |
jobs | Show shell jobs |
bg | Run stopped job in background |
fg | Bring job to foreground |
kill PID | Terminate process |
kill -9 PID | Force terminate |
pkill name | Kill by process name |
nohup command & | Keep process running after terminal closes |
Key Point
Foreground → Background:
Ctrl + Z → bgBackground → Foreground:
fgTerminate:
kill <PID>.jpg?table=block&id=29d76b1d-f1a8-8072-a9bf-cc78d1c7d881&cache=v2)