Viewing and managing processes
Inspect what's running with ps and top/htop, and stop misbehaving processes with kill.
List running processes
ps aux shows every process on the system in a flat list; ps -ef is the equivalent in a different (POSIX) format. Both are available on every distro with no install.
ps aux
ps aux | grep nginx
pgrep -a nginxLive view: top and htop
top ships everywhere and shows CPU/memory usage updating in place. htop is a nicer, color, scrollable version but needs installing first.
top
sudo apt install htop # Ubuntu/Debian; dnf/zypper/pacman/apk install htop elsewhere
htopStop a process
kill sends a signal by PID; SIGTERM (the default, 15) asks the process to shut down cleanly, SIGKILL (9) forces it immediately and should be a last resort since it skips any cleanup. killall targets by process name instead of PID.
kill 1234 # SIGTERM: ask it to stop
kill -9 1234 # SIGKILL: force it
killall nodePriority: nice and renice
nice starts a new process with a given priority (-20 highest, 19 lowest, default 0); renice changes the priority of a process that's already running.
nice -n 10 ./backup.sh
renice -n 10 -p 1234