ps auxShow all processes with user, CPU, memory, and command columns.
Comprehensive Linux process inspection, control, scheduling, and backgrounding workflows.
Find, list, and summarize running processes.
ps auxShow all processes with user, CPU, memory, and command columns.
ps -efShow all processes with PID, PPID, start time, and command.
ps -u "$USER" -fFilter processes by effective user and show full format.
ps -p 1234 -fInspect a specific process by PID.
ps -ef --forestRender a process tree using ps output.
pgrep nginxReturn matching PIDs for a process name pattern.
pgrep -af "python.*worker"Match against the full command line and print PID plus command.
pidof sshdList the PIDs of a program by executable name.
pstree -apDisplay process hierarchy with PIDs and arguments.
ps -eo pid,ppid,user,%cpu,%mem,stat,start,time,cmd --sort=-%cpuBuild a custom process table and sort by CPU usage.
ps -eLf | headList lightweight processes or threads.
pgrep -o sshdReturn the oldest matching PID.
pgrep -n sshdReturn the newest matching PID.
Focus on exactly the processes you need.
ps -eo pid,comm,%cpu,%mem --sort=-%cpu | headShow the most CPU-intensive processes first.
ps -eo pid,comm,%mem,rss,vsz --sort=-%mem | headShow the most memory-intensive processes first.
ps -t pts/0 -fShow processes attached to a terminal.
ps --ppid 1 -fList child processes of a specific parent.
pgrep -u www-data nginxLimit matches to one or more users.
pgrep -s 1234Match processes in a session ID.
pgrep -t pts/0Match processes running on a specific terminal.
ps -e -o pid,stat,cmd | awk '$2 ~ /^Z/ {print}'Find processes in a given state, here zombies.
lsof -iTCP:8080 -sTCP:LISTEN -PnIdentify the process bound to a TCP port.
ss -lntpList listening TCP sockets with process info.
Terminate, pause, resume, and signal processes safely.
kill 1234Ask a process to terminate gracefully.
kill -9 1234Immediately kill a process that is not responding.
kill -HUP 1234Commonly used to ask daemons to reload configuration.
kill -STOP 1234Suspend execution without terminating the process.
kill -CONT 1234Resume a stopped process.
pkill nginxSignal all processes whose names match a pattern.
pkill -f "gunicorn: worker"Match against full command lines.
pkill -u aliceSignal all processes owned by a user.
killall nodeKill all processes that match an executable name.
kill -lPrint known signal names and numbers.
pgrep -f "celery worker" | xargs kill -TERMSignal all matching PIDs found via pgrep.
fuser -k 8080/tcpKill the process that is using a TCP port.
Adjust scheduling priority and pin workloads.
nice -n 10 long-running-jobRun a command with a niceness offset.
renice 5 -p 1234Adjust niceness for an existing process.
chrt -p 1234Inspect real-time scheduling policy and priority.
sudo chrt -f -p 50 1234Assign a real-time FIFO scheduler to a process.
taskset -c 0,1 myserverPin a command to specific CPU cores.
taskset -cp 0-3 1234Inspect or update CPU affinity for an existing process.
ionice -c2 -n7 updatedbRun a command with lower I/O priority.
ionice -c3 -p 1234Set idle I/O scheduling for a running process.
ulimit -u 4096Cap the number of user processes for the current shell.
Keep commands running after you disconnect or background them safely.
nohup ./worker.sh > worker.log 2>&1 &Keep a process running after the shell exits.
setsid ./server.shStart a process in a new session detached from the terminal.
screen -S myjobUse screen for a resumable terminal session.
tmux new -s myjobUse tmux for persistent terminal multiplexing.
timeout 30s ./script.shTerminate a command if it runs too long.
time tar -czf backup.tgz /srv/dataMeasure runtime of a command.
watch -n 2 "ps -eo pid,comm,%cpu --sort=-%cpu | head"Re-run a command periodically for live monitoring.