Did you know?
Ctrl+Z pauses a running command; bg resumes it in the background.
fg brings it back, and jobs lists everything you have paused or sent away.
- Shell & terminal
- Last checked
Explained
Started a long copy or download in the foreground and need your terminal back? You don’t have to cancel it. Press Ctrl+Z to suspend the process, then type bg to let it continue in the background:
rsync -a /data/ /backup/data/
^Z
[1]+ Stopped rsync -a /data/ /backup/data/
bg
[1]+ rsync -a /data/ /backup/data/ &
Useful job commands:
jobslists background and stopped jobs with their numbers.fgbrings the most recent job back to the foreground;fg %2picks job 2.disowndetaches a job from the shell, so it keeps running after you close the terminal.
For work you already know will run for hours, start it in a tmux or screen session, or with nohup, so an SSH disconnect can’t interrupt it.
Learn more
- How to Move Running Command to Background in Linux Full guide · Updated Apr 2025
