Foreground and background

When a process is launched, it is normally in the foreground, which will prevent communication with the shell until the job is finished or interrupted. Launching a process with an & symbol at the end of the command (cat file.txt &) will launch it in the background, making it possible to keep using the shell. The SIGTSTP signal can be sent with Ctrl Z, which allows the user to suspend the foreground process from the shell. It can be resumed with the fg command, or in the background with the bg command.

The jobs command reports the jobs running and their numbers. In the output, the numbers in square brackets are the job numbers that are used by the process control commands, such as fg and bg.