CTRL Z, stop and restart Linux jobs

Written by
Date: 2008-12-20 10:36:30 00:00


A really good shortcut is [Ctrl+z], which stops a currently running job, which you can later terminate or resume it, either in foreground or background.

The way to use this is to press [CTRL+z] while executing a job (task), this can be done with any application started from the console.

i.e.:

htop

Then press [CTRL+z], and htop will be stopped, you can now check the running jobs.

jobs

You will see something like this:

ggarron@gentoo ~ $ jobs 
[1]+  Stopped                 htop

Use fg, to restart the stopped program, and put it to foreground, or bg, to translate it to background.

Take note that these commands work only on the active shell, it means the one from where you start the stopped applications.

To start a program directly to background use &, i.e.

firefox &

These is the way I usually start firefox, when using fluxbox.