Processes and Job Control Flashcards
to list processes currently running type this command:
ps
additional ps Options:
ps -e everything, all processes
ps -f full format listing
ps -ef Display all processes, full
ps -u username display username’s processes
ps -p pid display information for PID
ps -eH Display a process tree
ps -e –forest Display a process tree
pstree displays processes in a tree format
top Interactive process viewer
htop Interactive process viewer (less common not in all Distros)
To run processes in the background:
“command” & start’s the command in the background
Ctrl-c kill the foreground process
Ctrl-z Suspend the foreground process
Background a suspended process
bg [%num]
Foreground a background process
fg [%num]
Kill a process by job number or PID
kill
to list jobs
jobs [%num]
send a kill signal to a process
kill [-sig] pid
ex:
pid sig pid sig pid
kill 123 kill -15 123 kill -TERM 123 or use -9 to terminate
to display a list of kill signals
kill -l