O'Reilly logo

SAMS Teach Yourself Unix in 10 Minutes by Robert Shimonski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Ctrl+z and bg

In Unix, you can stop any process that is running by pressing Ctrl+z. Suspending a command and moving it to the background is another story. If you want to do this, you must be familiar with Ctrl+z as well as another command: the bg command.

To turn any process into a background process, first press Ctrl+z to suspend the process if it is running and you did not enter an ampersand following the command. Consider the following example:

Ctrl+z
[10]+  Stopped                 at 2

Here, the at command has been suspended and assigned job number 10.

The process ID (PID) (as shown with the ps command) is a number used by the kernel to keep track of every process running on the system. This is not the same as the job number. The job number will identify ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required