Common process management commands in Linux

Source: Internet
Author: User

A. Shell supports role control by using the following commands:
1. Command & run the process in the background
2. Jobs view the processes running in the background
3. FG % N bring the processes running in the background to the foreground
4. bg % N let the process n go to the background;
PS: "N" indicates the process number viewed by jobs.

B. Related commands

FG, BG, jobs, &, CTRL + Z are all related to system tasks. Although these commands are rarely used, they are also very practical.
I. & Most frequently used
This command is used at the end of a command and can be executed in the background.
II. CTRL + z
You can put a command that is being executed on the foreground in the background and pause it.
3. Jobs
View the number of commands currently running in the background
4. FG
Move the commands in the background to the foreground to continue running.
If there are multiple commands in the background, you can use FG % jobnumber to call up the selected command. % jobnumber is the serial number (not PID) of the command being executed in the background found through the jobs command)
5. BG
Pause a command in the background to continue execution.
If there are multiple commands in the background, you can use BG % jobnumber to call up the selected command. % jobnumber is the serial number (not PID) of the command being executed in the background found by the jobs command)

# Use shell commands in Linux to control jobs execution
The following commands can be used to manipulate process tasks:
PS: Lists processes running in the system;
Kill sends signals to one or more processes (often used to kill one process );
Jobs lists the status of started tasks in the Current Shell environment. If jobsid is not specified, the status information of all active tasks is displayed; if the termination of a task is reported (that is, the task state is marked as terminated), shell deletes the process ID of the task from the List known in the Current Shell environment;
BG moves the process to the background );
FG moves the process to the foreground for running (foreground );

Transfer the job to the background for running
If you often work in x graphics, you may have the experience of running a GUI program through Terminal commands. The GUI is displayed, but your terminal remains in the same place, you cannot execute other commands in shell unless you disable the GUI program.

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.