Linux Learning Notes 033_11 process

Source: Internet
Author: User
Tags cpu usage

PS: (process information, static)

Displays process information without parameters showing the process of the current terminal

A: Processes that include all terminals

X: Processes that are not part of any terminal, and processes that are not related to any user

U: Show the owner of the process

F: Show the dependent relationship of the process (dependency, parent-child process)

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/46/2F/wKiom1PuGn6xSrj3AADAdYR-7fA658.jpg "title=" Clipboard1.png "alt=" Wkiom1pugn6xsrj3aadadyr-7fa658.jpg "/>

USER: Owner of the process

PID: Process ID, sorted by process ID by default

VSZ: How much virtual memory the program calls at run time

RSS: Real Memory

Tty:? Does not belong to any terminal and runs before it enters the terminal

STAT: status, S for sleep

Time: Process duration

Command: command to run this process

PS Axo pid,%cpu: Customize the information you want, just look at the PID and CPU usage

Pgrep-u Root: Filtering out the process of having an artificial root

PGREP-G student: Filtering out the process of all members of the student group

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/2F/wKiom1PuG3XjL2FoAAA0XZz7eOU408.jpg "title=" Clipboard2.png "alt=" wkiom1pug3xjl2foaaa0xzz7eou408.jpg "/>650" this.width=650; "src="/e/u261/themes/default/ Images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px Solid #ddd; "alt=" spacer.gif "/>:httpd which processes this program calls

Pstree: Show Process Tree

Top: Dynamically refreshed processes, sorted by CPU usage, 5s refreshed once

Signal (signal):

15: Normal End

9: Forced end, will produce junk file

1: Re-read the configuration file, such as modify the FTP configuration file to take effect immediately to reread the configuration file, without affecting existing users, you can also use the service vsftpd reload, the same effect, the actual signal is sent 1, but some applications do not support

Man 7 signal: see all the signals help

End Process:

by Pid:kill-[15,9,1] 6316: Default 15, Normal end

by Name:killall httpd: Some applications have many processes, by name more convenient

by Pattern:pkill process name/pid

Process priority:

The value of Nice is the process priority, the range is -20~19, the smaller the number, the higher the priority, and the default is 0.

Ps-o

PS Axo Pid,nice,comm: View process priority

The NI field in top is prioritized to show only the top 10 most resource-intensive processes

Adjust priority: (only root can increase priority, normal user can only lower priority)

Before operation: Nice-n 5 comm:nice-n 5 Vim A.txt

Running: renice-5 pid:renice-5 4813

Process management for graphical interfaces:

Gnome-system-monitor

Change a program to run in the background:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/2F/wKiom1PuHNOw6he-AABFE-0aTdw057.jpg "title=" Clipboard3.png "alt=" Wkiom1puhnow6he-aabfe-0atdw057.jpg "/>

Because the/usr/directory is relatively large, it will execute very long card here, you can enter & and then return the process into the background to run, the jobs command can see that it is running

To pause a running process:
Crtl+z or send a signal 19

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/46/31/wKioL1PuHiGic70jAABIW81ClYM313.jpg "style=" float: none; "title=" Clipboard4.png "alt=" Wkiol1puhigic70jaabiw81clym313.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/46/31/wKioL1PuHiHjG9VEAACG0Z26_L8490.jpg "style=" float: none; "title=" Clipboard5.png "alt=" Wkiol1puhihjg9veaacg0z26_l8490.jpg "/>

+ Is the default task

[1] for task number

BG% task number: Activates background paused tasks, and also works in the background after activation

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/2F/wKiom1PuHXiAkz3YAABEQmglFMI935.jpg "title=" Clipboard6.png "alt=" Wkiom1puhxiakz3yaabeqmglfmi935.jpg "/>

FG% Task Number: Pull the background paused task to the front and work

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/46/31/wKioL1PuHp6xkI6oAABdm80JSZ8332.jpg "title=" Clipboard7.png "alt=" Wkiol1puhp6xki6oaabdm80jsz8332.jpg "/>

Kill [-signal]% task number: End daemon, does not produce junk files

Scheduled tasks: (process not immediately executed)

At: Scheduled tasks are executed only once

Crontab (Scheduled Tasks): Periodic execution, can also implement the function of at

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/46/31/wKioL1PuHxmRIvQrAABXDUqZEHM876.jpg "title=" Clipboard8.png "alt=" Wkiol1puhxmrivqraabxduqzehm876.jpg "/>

At

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/30/wKiom1PuHhPTW95BAABvjZja5so314.jpg "title=" Clipboard9.png "alt=" Wkiom1puhhptw95baabvjzja5so314.jpg "/>

Crtl+d End Edit

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/31/wKioL1PuHznRj4W1AAAnArJdL10080.jpg "title=" Clipboard10.png "alt=" Wkiol1puhznrj4w1aaanarjdl10080.jpg "/>

Delete

The at task cannot be edited, not displayed on the display, to be viewed via mail

Crontab

CRONTAB-E: Editing tasks

Time format: Minute hour day month Week (0~6)

0 * * * echo Hello: Daily Two o'clock in the afternoon print Hello

0 * *1,6 *1-5 echo Hello: 1 per year, June 1-5 2 o'clock in the afternoon every week

* */1 * * * echo Hello: Every hour

Vim/etc/crontab:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/46/30/wKiom1PuHoyCSeGoAAC97YWNURs477.jpg "title=" Clipboard11.png "alt=" Wkiom1puhoycsegoaac97ywnurs477.jpg "/>

Execute all files under folders at different times

Command result Status:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/46/30/wKiom1PuHpiyacLFAAAu80pFTKw753.jpg "title=" Clipboard12.png "alt=" Wkiom1puhpiyaclfaaau80pftkw753.jpg "/>

0 stands for Success, 1~255 represents failure

Command relationship:

&&: With relation, command 1 && command2: Command 1 execution succeeds before command 2

|| : or Relationship: Command 1 | | Command 2: Command 1 execution failed to execute commands 2

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/30/wKiom1PuHqajbOUaAACR_XVgjyU513.jpg "title=" Clipboard13.png "alt=" Wkiom1puhqajbouaaacr_xvgjyu513.jpg "/>

Test
A=123

B=123

Test "$A" = "$B"

echo $?

0

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/30/wKiom1PuHxzDSa3LAADLp1NsDNk902.jpg "title=" Clipboard14.png "alt=" Wkiom1puhxzdsa3laadlp1nsdnk902.jpg "/>

-F: File exists and is a regular file: Test-f a.txt && echo "A.txt exit and it's a regular file"

-D: File exists and is a directory

-x: File exists with execute permission

If

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m01/46/31/wkiol1puibpbat3caacdgigpyrg281.jpg "title=" Clipboard15.png "alt=" Wkiol1puibpbat3caacdgigpyrg281.jpg "/>

Ping Station1, if a successful print Station1 IP up, if it fails, the Lookup maintenance list has no station1 if there is a print station1 is undergoing maintenance, if not then print Station1 is Unexpectedly down, and returns 1


This article is from the "FLYCLC" blog, make sure to keep this source http://flyclc.blog.51cto.com/1385758/1540856

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.