Switch back and forth commands in Linux: Ctrl+z,bg,fg,jobs

Source: Internet
Author: User

I want to switch to the background to run some services:

Two methods:

1. You can add a character & to the last face of the start Service command at runtime, for example./servicestart &

2. After the service starts, press CTRL + Z to switch the service to the background and pause, then use the command: BG number starts the service in the background and can use jobs to view the tasks in the background after startup.

Note: number is the job ID, after pressing CTRL + Z, the terminal will display the service's job number, for example, I press CTRL + Z

^z
[1]+ Stopped./servicestart
So the job number is 1.

Second, want to switch the service running in the background to the foreground, enter the command: FG number

For example: BG 1

Switch back and forth commands in Linux: Ctrl+z,bg,fg,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.