Job is divided into foreground job and background job
The foreground job (foreground) is started through the terminal, and the boot will always occupy the terminal. such as VIM, CP
Background jobs (background) can be started through the terminal,
How do I get my job running in the background?
1. If the job is already running, you can use ctl+z, but this command will cause the job to stop. Using the Kill-s 18 command to get the process back up and running
2. If the job is not running, use the & symbol when starting the job.
Note: If the job is related to the terminal, once the terminal is disconnected, then the job is stopped, regardless of whether the job is running in the foreground or in the background. You can use nohup Command & commands If you want to revoke the connection to the terminal from the job sent to the background.
Kill-s 18 can continue to let the stopped process run, but the results of the run will be displayed to the foreground, the process needs to be dispatched to the foreground, and then Ctl+z stopped.
Jobs
View all Jobs
Fg
Schedule a background job to the foreground
FG can pick up the job number
1 2 is the job number, and the + number represents the job that is scheduled by the FG by default. -number indicates a priority less than the + sign. + Number of jobs processed, the default is to start processing-number of jobs.
Bg
Let the background jobs continue to run
After hitting BG , the process is running in the background, but the results of the operation show to the foreground, this time knocking Ctl+z does not have any effect. the process needs to be dispatched to the foreground with FG before Ctl+z.
The same effect as the Kill-s PID.
Kill interrupts the job process
This phenomenon will be gone in a little while. Terminated
The Linux Process Management command jobs