DEV Community

Andreas Bergström
Andreas Bergström

Posted on • Edited on • Originally published at andreasbergstrom.dev

Suspend and resume shell processes

When a long-running shell command is hogging your terminal and you'd rather not kill it, Ctrl+Z pauses it in place and hands you back the prompt. fg resumes it in the foreground; bg keeps it paused-but-running in the background so you can carry on with other work. jobs lists everything you've stashed away.

The full post walks through a cp example end-to-end — suspend, list, resume, suspend again, push to background — so the muscle memory clicks. Small toolbox, but it turns "oops, I forgot I needed the shell" from a Ctrl+C into a non-event.


Originally published at andreasbergstrom.dev — read the full post there.

Top comments (0)