Being able to master the use of background jobs in Linux is very important and is a great way to increase efficiency. Useful commands are outlined below.
When a job is currently running
- ctrl -z : suspend a job
+ Stopped ./ExampleScript.sh
- ctrl -c : terminate a job
- List all jobs e.g.
+ Running ./ExampleScript.sh &
- Start a job in the background with <command> & e.g.
- Kill job using kill %jobnumber e.g.
+ Terminated ./ExampleScript.sh
For a suspended job
- Continue job in background : bg %jobnumber :
+ ./ExampleScript.sh &
- Bring job to foreground : fg %jobnumber e.g.