"Operation Control Series"-"Linux command five-minute series" Ten

Source: Internet
Author: User

This original article belongs to the "Linux Greenhouse" blog.

The blog address is http://roclinux.cn.

Article author for Roc

I hope you can donate to support the operation and development of the Linux greenhouse blog. See "About Donations"

==

I haven't made this series in a long time. have been looking at Perl. Now return. Because all scripts are found to be based on Linux commands ...= =In Layman's words, a Job control command is used to control a task. 1 I want to put the updatedb command (the command to re-establish the whole index) to run in the background. Because I don't want to watch the machine build the index, I want to make a program:# UpdateDB &[1] 23336Note: Add a space after the command you want to execute, plus the & symbol to enable background execution. The returned [1] indicates that this is the first task you put into the background. 23336 is the process number for this task.

2 I forgot to add & when I executed updatedb, what do I do? There are ways to:Press the Ctrl-z key on the keyboard, you can throw the foreground task to the backstage! But it is important to note that, with ctrl-z words, this task to the backstage but stopped state. (You have ruthlessly ctrl-z it to the backstage, how can it still work hard to continue working in the background? )3 I learned this trick, I put a lot of programs in the background to execute. I'd like to check:# Jobs[1]+ Running UpdateDB &Note: A list of tasks that are running in the background is displayed4 I'm finished with programming. Want to put the updatedb back to the front desk to see. # FG%1Note: The F in FG indicates the meaning of front, the foreground. %1 represents a task number 1th listed in the Jobs command. If it's task number 2nd, I guess you know how to write it. 5 If you use the jobs command to find a task that shows [stopped] (the task number is 2), I want this task to continue executing in the background:# bg%2Note: The status of stopped usually occurs after the user ctrl-z. 6 I want the background task number to be 3 for the task to be canceled:# Kill%3Note: This kills a background task with task number 3.

"Operation Control Series"-"Linux command five-minute series" Ten

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.