fg, Ctrl-z and jobs

Tags:

Pausing Commands

Ctrl-z

To pause a task in the terminal press Ctrl-z. That will free up the terminal for other tasks, while still running your other tasks in the background.

fg

If you have sent a program into the background with Ctrl-z, you can bring it back to the foreground with the fg command. If you have more than one program running in the background, you can put the number of the job after the command.

jobs

Typing jobs in the terminal will give you a list of all the programs running in the background:

$ jobs
[1]-  Stopped                 vim linux_seo_tools.html
[2]+  Stopped                 man iwlist

To restart my instance of vim in the above example, I would type fg 1. To restart the man page, I would type fg 2.

No votes yet
Syndicate content