Display current processes
-e: all processes, -f: full format, -C command name, -u username
ps -ef
Filter by command
ps -fC <command list>
ps -fC nmap
ps -fC nmap,bash
Filter on user
ps -fu <user list>
ps -fu kali
Kill a process
kill <process ID>
kill 1234
Force kill
kill -9 <process ID>
CPU intensive processes
ps -ef | sort +3 -r | head -n 10
Background a process
<command> &
sudo nmap -T1 -sS -p 1-65535 127.0.0.1 &
Jobs running in current terminal session
jobs
Bring the job to foreground
fg
fg %<job ID, or PID, or beginning of command, or %+ or %% for current job, or %- for previous job>
fg %1
Suspend a process running
Press Ctrl + Z
Resume a process in the background
Be careful if the job is time sensitive, it could give wrong results.
bg
Cancel a process running
Press Ctrl + C