Shell task control

Source: Internet
Author: User

Tag: Shell

Shell task control terms:

(1) Foreground task: Run in shell. The shell prompt does not appear before the task is completed, so other tasks cannot be run at the same time.

(2) Background task: Run in shell, but not exclusively in shell. The shell prompt can appear before the task is completed. Therefore, you can run other tasks in the same shell at the same time.

(3) pause: temporarily stop running foreground tasks

(4) resume: Resume paused tasks.

The following are some common commands:

(1) jobs: list all running tasks in Shell

(2) Ctrl + Z: Hold the foreground task. The paused task is paused, but its status will be recorded.

(3) suspend: Pause the shell, that is, CTRL + Z is run on the shell. It is mainly used to enter another shell with the su command and then want to return to the original shell.

(4) FG: Restore task. Run the task on the foreground. Put the task suspended or running in the background to the foreground. If no parameter is specified, a task is automatically selected, usually a recently suspended task or a task that has been recently executed in the background. If you want to affect a specific task, you can add a percent sign before the task number (obtained by jobs ).

(5) BG: puts paused tasks in the background for running. If no parameter is specified, it only takes effect for recently suspended tasks. If you want to affect a specific task, you can add a percent sign before the task number (obtained by jobs ).


Related Article

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.