Quickly move tasks between background and foreground to stay productive on the command line. 16.11.2025 | reading time: 2 min On the shell a process can be suspended, resumed in the background, or brought back to the foreground; learn to use bg and fg to do exactly that and to keep the terminal responsive while work continues. A hands on session Try this in a terminal to see job control in action ```bash $ sleep 100 ^Z [1]+ Stopped sleep 100 $ bg %1 [1]+ sleep 100 & $ jobs [1]+ Running sleep 100 & $ fg %1 sleep 100 ``` Practical notes you will use Suspend a running job with Ctrl Z, resume it in background with `bg` and bring it back with `fg`; address jobs by number with percent notation like `%1` or by pid in some shells; `jobs` shows state, and `fg` will attach the selected job to the terminal so it receives input again. When bg and fg are not enough For long lived or detached tasks prefer tools that survive terminal logout such as `nohup`, or full session managers like screen or tmux; for one off detaches use `disown` after backgrounding to remove the job from the shell job table. Quick troubleshooting tips If a job refuses to resume check signals and process state with `ps` and use `kill -CONT` to continue or `kill -STOP` to stop; remember background jobs still consume resources so monitor them and kill if necessary. Final thought Mastering bg and fg makes the shell feel more like an extension of your workflow and less like a bottleneck; keep practicing and consider formal study to deepen skills with certifications such as CompTIA Linux+ or LPIC-1 and with intensive exam preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. processes utilities troubleshooting scripting