RHCE Study Notes (7) Process Management

Source: Internet
Author: User

This section is much simpler than the previous one, mainly familiar with the common commands associated with process management under Rhel PS aux, pstree,top, Jobs, kill, BG, FG


A process can run another process on the basis of one process, which is called the parent process, which is a child process.

For example, I open a terminal, this is a process, and then I execute the command above, open a new program, the new program is a child process.


For example, I open Firefox


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/57/6C/wKiom1SZ-XehIa_qAAFunf_8QSQ655.jpg "style=" float: none; "title=" 1.PNG "alt=" Wkiom1sz-xehia_qaafunf_8qsq655.jpg "/>

The process tree can be viewed by pstree at this time.


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/57/6A/wKioL1SZ-iPiKbZ9AAEvzYDLgHc124.jpg "style=" float: none; "title=" 2.PNG "alt=" Wkiol1sz-ipikbz9aaevzydlghc124.jpg "/>


Search Firefox, you can see that Firefox is Termianl's child process


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/57/6C/wKiom1SZ-XjAbUlnAADizIF10I8946.jpg "style=" float: none; "title=" 3.PNG "alt=" Wkiom1sz-xjabulnaadizif10i8946.jpg "/>


In addition to pstree, we often use PS to view the current process. PS can only view the process of the current terminal, PS aux to see all the processes, this co-grep can see the status of the process we need.


For example, we can use the following 3 different commands to view the Firefox process, note that pidof must be the full name of the process

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/57/6C/wKiom1SZ-XrStWQVAAEOFTVxCrk309.jpg "title=" 5.PNG " Style= "Float:none;" alt= "wkiom1sz-xrstwqvaaeoftvxcrk309.jpg"/>


PS aux is a static display of the process of a moment, if you need to dynamically display real-time information, you can use the top



How do I turn off a process? We can use the KILL command.


Kill-l can display the code of the signal, where 2 is equivalent to CTRL + C, 9 forced exit, 15 is the default value, close the program


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/57/6A/wKioL1SZ-iTCx2lgAALxyW9kbT0423.jpg "style=" float: none; "title=" 4.PNG "alt=" Wkiol1sz-itcx2lgaalxyw9kbt0423.jpg "/>


If I need to force Firefox off, run Kill-9 1359.


Finally we look at the foreground program and background program.


If I directly execute Firefox, he will open a Firefox interface, but this time my terminal will not be able to continue to input, this is because Firefox runs in the foreground, how to switch to the background, you can press CTRL + Z, the state becomes stop, this time again input BG, Switch to the background, enter jobs to view background programs, and enter FG to switch back to the foreground.


If you want to run directly in the background, add a & symbol on the back, such as Firefox &



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/57/6A/wKioL1SZ-iXDr9DOAADIyAaKDZc287.jpg "style=" float: none; "title=" 6.PNG "alt=" Wkiol1sz-ixdr9doaadiyaakdzc287.jpg "/>




This article is from the "Mapo Tofu" blog, please be sure to keep this source http://beanxyz.blog.51cto.com/5570417/1594594

RHCE Study Notes (7) Process Management

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.