Job: a process or a group of processes associated with pipelines/redirection.
Foreground: The environment in which the client session interacts with you.
Background: The environment that does not interact with you, but is related to the current terminal session. For example, if you cannot enter a background job or control a background job (for example, you cannot use Ctrl + C to disable it), the background job is also disabled when the current terminal session is closed.
Background: that is, the system background. There is no direct relationship with the terminal session.
Run in background Mode
&: Add & after executing the job command &. For example, $ echo file1> file2 &
CTRL + Z: press Ctrl + C to convert the job running in the foreground into a background and suspend it. Then run BG % <number> on the background.
Jobs
Syntax: jobs [-LRS]
Description: displays background tasks.
Parameters:
-L: Besides listing the job number and command string, the PID Number is also listed;-R: only listing the work in the background run;-S: only list the jobs that are being paused in the background.
FG BG
Syntax: FG/BG [% <number>]
Note: FG transfers jobs in the background to the foreground for execution. BG switches the background job from pending to running.
Parameter: % <number> number indicates the serial number of the background job, which can be queried by the jobs command.