Managing Processes
- There are Processes (managed by the kernel) and there are Jobs
- Jobs cant contain multiple processes
- Jobs also can be suspended and resumed at a later stage
Backgrounding Processes (bg
)
- To send a command straight to the background ad a
&
at the end of the command ping -c 400 localhost > ping_results.txt &
- If you forgot you can also press
Ctrl + Z
to suspend it and then runbg
to run it in the background
Jobs Control: jobs
and fg
jobs
: Get list of jobsfg %<job-id>
Bring the job to the foreground
Process Control: ps
and kill
ps
lists jobs system wide, not just for the current shell as we get withjobs
-e
get all processes-f
full format output-C
only the the processes for a given command namekill <PID of the process>
to terminate the process
Relevant Note(s): Linux Basics