The Linux Process Management command jobs

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.