Program management-ps, top, pstree, kill, killall

Source: Internet
Author: User
Program management-ps, top, pstree, kill, killall1, program observation-commonly used ps: One is that you can only view your own bash Program & amp; lsquo; ps-l & amp; rsquo;, one of which is to check all the programs running in the system & amp; lsquo; psauxf & amp; rsquo ;. Www.2cto.com... program management-ps, top, pstree, kill, killall 1. program observation-ps commonly used: one is to view only the 'PS-L' of your bash program ', one is to check the programs running in all systems 'PS auxf '. Www.2cto.com [root @ www ~] # Ps-lF s uid pid ppid c pri ni addr sz wchan tty time limit 4 S 0 13639 13637 0 75 0-1287 wait pts/1 00:00:00 bash4 R 0 13700 13639 0 77 0- 1101-pts/1 00:00:00 ps description: f: process flags indicates the summary permission of the program. common numbers include: if it is 4, the permission of the program is root; if the value is 1, this subroutine is only copied (fork), but not actually executed (exec ). Www.2cto.com S: represents the state of the program (STAT), the main state is: R (Running): The program is Running; S (Sleep ): the program is currently in sleep status (idle), but can be awakened (signal ). D: sleep state that cannot be awakened. Generally, this program may be waiting for I/O (ex> printing) T: stop ), it may be in the work control (background pause) or traced state; Z (Zombie): Zombie state, where the program has been terminated but cannot be removed from the memory. C: indicates the CPU usage, in percentage; PRI/NI: Priority/Nice stands for the Priority of CPU execution of this program, the smaller the value, the faster the program is executed by the CPU. ADDR/SZ/WCHAN: all of them are related to memory. ADDR is the kernel function, which specifies the part of the program in memory. if it is a running program, generally, '-'/SZ indicates the amount of memory used by the program./WCHAN indicates whether the program is currently running. Similarly, if '-' indicates that the program is running. TIME: the cpu time used. Note that it is the actual cpu time consumed by the program, rather than the system TIME. the ps aux columns are somewhat different. VSZ: the virtual memory used by the process (Kbytes), RSS: the fixed memory used by the process (Kbytes) 2. dynamic observation of program changes-top [root @ www ~] # Top [-d number] | top [-bnp Paribas] option and parameter:-d: The number of seconds that can be followed, that is, the number of seconds that the entire program screen is updated. The default value is 5 seconds.-B: top is executed in batches. more parameters can be used! Usually, the batch results are output as files in combination with data stream redirection. -N: used with-B. It indicates that the output result of the top number is required. -P: specify some PIDs for observation and monitoring. Key commands that can be used during top execution :?: Key commands that can be entered in top, commonly used-P: sorted by CPU usage resources, M: sorted by Memory usage resources, and N: sort by PID! T: the cpu time accumulation (TIME +) used by the Process is sorted. K: Give a PID a signal (signal) r: Give a pid a New nice value. Q: The button to exit the top software. 3. show the program tree-pstree [root @ www ~] # Pstree [-A | U] [-up] option and parameter:-A: the connections between the program trees are connected using ASCII characters;-U: the connections between different Program trees are connected by the characters of the universal code. Errors may occur in some Terminal Interfaces. commonly used:-p: And the PID of each process is listed at the same time. commonly used:-u: and the account name of each process is listed at the same time. 4. kill-signal PID or % work number signal mainly includes 1-restart, 9-force off, 15-normal off 5, killall-signal Command name [root @ www ~] # Killall [-iIe] [command name] options and parameters:-I: interactive meaning, interactive, if you need to delete, a prompt character will appear to the user;-e: exact indicates that 'command names followed by them must be consistent ', but the entire command cannot exceed 15 characters. -I: the command name (which may contain parameters) is case-insensitive.
 
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.