#ps
List processes
ps [options]ps auxEvery process, with owner, CPU and memory
ps aux | grep nginxFind one program
ps -ef --forestShow a parent-and-child tree
psList processes
ps [options]ps auxEvery process, with owner, CPU and memory
ps aux | grep nginxFind one program
ps -ef --forestShow a parent-and-child tree
topLive process monitor
toptopLive list; press q to quit, M to sort by memory, P by CPU
htopFriendlier live monitor
htophtopColoured view; use F9 to kill, F6 to sort
killStop a process by number
kill [-signal] PIDkill 1234Politely ask process 1234 to stop
kill -9 1234Force it to stop (last resort)
kill -HUP 1234Ask a service to reload its settings
pkill / killallStop processes by name
pkill name | killall namepkill -f "python app.py"Stop processes whose command matches
killall nodeStop every process called node
pgrepFind a process number
pgrep [-a] namepgrep -a nginxShow PIDs and full commands
jobs / bg / fgBackground jobs in your shell
command & | jobs | bg | fgsleep 300 &Start a command in the background
jobsList your background jobs
fg %1Bring job 1 to the front
nohupKeep running after you log out
nohup command &nohup ./long-task.sh > out.log 2>&1 &Survives closing the SSH session
nice / reniceChange priority
nice -n N command | renice N -p PIDnice -n 10 ./backup.shStart with lower priority
sudo renice -n 5 -p 1234Change a running process
systemctlManage services
systemctl action servicesystemctl status nginxIs it running? Shows recent log lines too
sudo systemctl restart nginxStop and start
sudo systemctl reload nginxRe-read settings without dropping connections
sudo systemctl enable --now nginxStart now and at every boot
systemctl list-units --failedSee what has failed
journalctlRead service logs
journalctl [options]sudo journalctl -u nginxLogs of one service
sudo journalctl -u nginx -fFollow the log live
sudo journalctl --since "1 hour ago"Recent entries
sudo journalctl -p err -bErrors since the last boot
crontabScheduled jobs
crontab [-e | -l]crontab -eEdit your jobs
crontab -lList your jobs
0 2 * * * /home/deploy/backup.shA line you can add: run every day at 02:00
screen / tmuxSessions that survive a dropped connection
tmux | screentmux new -s workStart a named session
tmux attach -t workCome back to it after reconnecting
tmux lsList sessions
SSH Command is a desktop app for Mac, Windows and Linux that puts a real terminal, SFTP file panes, a sudo switch and a searchable Linux command finder in one window. Type what you want to do, and send the command to your server with one click.
Download free Windows commands with examples SFTP & FTP client