Usually, when you start up a process, it takes over the terminal. These processes are thought of as running in the foreground. Let's now learn how to start a process in the background and how to move processes to and from the background/foreground.
More often than not we'll want to launch a program right away into our foreground. However, if we plan to run a process that may take a long time, we can place it in the background so we can have still access to the command line interface. This way you can access the shell while it completes.
To start a process in the background, place an ampersand (
&) after it.
$ gedit &  2314
The output it places it called the job number, These identifiers are useful, as we'll later see when we use them to send signals.
To see the list of all processes within the current session (including those in the background), use the
jobs command. This is especially useful before logging out of a session to ensure that all processes that you've started have closed.
$ jobs + Running gedit &
The number in brackets is the job ID, with the term
Running describing its state.
job command is useful to make sure all the processes have been properly closed before logging out. If not, client programs may freeze up if a lot of programs are still running.
To move a process to the background from the foreground, use the
bg command and its job number.
$ bg 1
To move this back to the foreground, simply input the job number and use that as the argument for the
$ fg 1
Relieve spasms, tight muscles, trigger points and pressure points with the Body Back Buddy! This trigger point massage is designed to help you self-message any area of your body - especially those that are hard to reach. Keeping your muscles relaxes and out of contraction is importan in helping to reduce pain and prevent muscle injury.$ Check price
In this completely revised second edition of the perennial best seller How Linux Works, author Brian Ward makes the concepts behind Linux internals accessible to anyone curious about the inner workings of the operating system. Inside, you'll find the kind of knowledge that normally comes from years of experience doing things the hard way.$ Check price