Skip to main content

Process Management

Description Commands
Daily drivers kill, pkill, killall, pgrep
Priority control nice, renice, psnice, chrt
Job control jobs, fg, bg, nohup, disown, setsid
Session management screen, tmux
Debugging strace, ltrace
Scheduling at, atd, atq, atrm, batch
Miscellaneous skill

Daily Drivers

kill

Usage       : kill -9 <PID>
Example     : kill -9 1234
Description : Terminate processes by PID.
Takeaway    : Use when you need to forcefully stop a specific process.

pkill

Usage       : pkill firefox
Example     : Kill all Firefox processes.
Description : Kill processes by name or attributes.
Takeaway    : Use when you want to terminate processes without looking up PIDs.

killall

Usage       : killall nginx
Example     : Stop all nginx processes.
Description : Kill processes by name (all instances).
Takeaway    : Use for stopping multiple processes of the same name.

Process Priority

nice

Usage       : nice -n 10 command
Example     : nice -n 15 gzip largefile
Description : Start a process with adjusted priority.
Takeaway    : Use to run tasks with lower priority to avoid hogging resources.

renice

Usage       : renice -n 5 -p 1234
Example     : Increase priority of process 1234.
Description : Change priority of a running process.
Takeaway    : Use to adjust performance of active processes.

psnice

Usage       : psnice -n 10 -p 5678
Example     : Lower priority of process 5678.
Description : Adjust process priority (similar to renice).
Takeaway    : Use for fine-grained priority control.

chrt

Usage       : chrt -r -p 1234
Example     : Assign real-time priority to process 1234.
Description : Set real-time scheduling policies.
Takeaway    : Use for advanced scheduling control.

Job Control

jobs

Usage       : jobs
Example     : Show running background tasks.
Description : List background jobs in the shell.
Takeaway    : Use to manage shell background processes.

fg

Usage       : fg %1
Example     : Resume job 1 in foreground.
Description : Bring background job to foreground.
Takeaway    : Use to interact with background jobs.

bg

Usage       : bg %1
Example     : Move job 1 to background.
Description : Resume job in background.
Takeaway    : Use to continue tasks without blocking terminal.

nohup

Usage       : nohup command &
Example     : nohup python script.py &
Description : Run process immune to hangups.
Takeaway    : Use for long-running jobs that survive logout.

disown

Usage       : disown %1
Example     : Disown job 1.
Description : Detach job from shell.
Takeaway    : Use to prevent jobs from being killed when shell exits.

setsid

Usage       : setsid command
Example     : setsid ./server
Description : Run process in new session.
Takeaway    : Use to detach processes from terminal session.

Debugging & Tracing

pgrep

Usage       : pgrep nginx
Example     : Get PID of nginx.
Description : Find processes by name.
Takeaway    : Use for quick PID lookup.

strace

Usage       : strace -p 1234
Example     : Debug process 1234.
Description : Trace system calls of a process.
Takeaway    : Use for diagnosing system call issues.

ltrace

Usage       : ltrace ./program
Example     : Debug shared library usage.
Description : Trace library calls.
Takeaway    : Use for debugging dynamic library interactions.

Task Scheduling

at

Usage       : echo "command" | at 5pm
Example     : Run backup at 5pm.
Description : Schedule one-time tasks.
Takeaway    : Use for delayed task execution.

atd

Usage       : systemctl start atd
Example     : Ensure at jobs run.
Description : Daemon for at jobs.
Takeaway    : Use to enable scheduled jobs.

atq

Usage       : atq
Example     : Show pending tasks.
Description : List scheduled jobs.
Takeaway    : Use to monitor scheduled jobs.

atrm

Usage       : atrm <jobid>
Example     : Cancel job 2.
Description : Remove scheduled jobs.
Takeaway    : Use to manage scheduled tasks.

batch

Usage       : echo "command" | batch
Example     : Run heavy job during idle time.
Description : Run tasks when system load is low.
Takeaway    : Use for deferred execution based on load.

Miscellaneous

skill

Usage       : skill -u user
Example     : Kill all processes of user.
Description : Kill processes interactively (like kill).
Takeaway    : Use for user-based process termination.

Tips, Tricks, Roadmaps, Resources, Networking, Motivation, Guidance, and Cool Stuff โ™ฅ

Updated on Dec 23, 2025