One Linux command per day (September)

Source: Internet
Author: User


2014-09-02

 Top real-time displays the resource usage of each process in the system, similar to the Task Manager command parameters for Windows:-B Batch Processing-c Display full command-I ignore failure process-S Secret mode-s cumulative mode-i< Time > Set interval-u< user name > Specify user name-p< process number > Specify process-n< times > number of cycles displayed instance: 1.top 2.top-p 574 shows the specified process Information 3.top-d 3 Set Information update time 4.TOP-N 2 Set Information update number, description Update 2 times after automatic termination 5.top-c display full command top detailed first line, task queue information, with the uptime command execution results, specific parameters said The situation is as follows: 14:06:23-current system time up to 70 days, 16:44-the system has been running for 16 hours and 44 minutes (during which the system has not restarted the Yo!).        2 users-currently has 2 users logged into the system load average:1.15, 1.42, 1.44-load average the three numbers are 1 minutes, 5 minutes, 15 minutes of load respectively.        The load average data is the number of active processes that are checked every 5 seconds and then calculated by a particular algorithm.   If this number is divided by the number of logical CPUs, the result above 5 indicates that the system is overloaded.   The second line, tasks-task (process), the specific information is described as follows: The system now has 206 processes, of which there are 1 running, 205 in hibernation (sleep), 0 in the stoped state, and 0 in the zombie State (zombie).        The third line, CPU status information, the specific properties are described as follows: 5.9%us-the percentage of CPU occupied by user space.        3.4% sy-The percentage of CPU consumed by the kernel space. 0.0% ni-Change the priority of the process to occupy the percentage of the CPU 90.4% id-idle CPU percentage 0.0% Wa-io waiting for CPU percentage 0.0% hi-hard Interrupt (Hardware IRQ) accounted for Percentage of CPU used        0.2% si-Soft Interrupt (software interrupts)% CPU Usage Note: There is a need to understand the knowledge of Linux system user space and kernel space, depending on the CPU utilization ratio and the Windows concept. The four-line, memory state, specific information is as follows: 32949016k total-total Physical Memory (32GB) 14411180k used-total Memory in use (14GB) 18537836k free-null          Total free memory (18GB) 169884k buffers-cache memory (169M) line fifth, swap swap partition information, specific information is as follows: 32764556k total-Total swap area (32GB) 0k used-Total swap area (0K) 32764556k free-free Swap area total (32GB) 3612636k cached-buffered swap area total (3.6GB) remarks          : The total amount of memory in use in line fourth (used) refers to the amount of memory that is now controlled by the system kernel, and the total amount of free memory that the kernel has not included in its control range.          The memory that is included in kernel management is not always in use, but also includes the memory that has been used in the past that can now be reused, and the kernel does not return these reusable memory to free, so there is less memory on Linux, but don't worry about it. If you are accustomed to calculating the number of available memory, here is an approximate formula: The fourth line of Free + fourth row of buffers + fifth row of cached, according to this formula available memory for this server: 18537836k +169884k +361          2636k = around 22GB.   For memory monitoring, in the top we have to monitor the fifth line swap partition used, if this value is constantly changing, indicating that the kernel is constantly in memory and swap data exchange, which is really not enough memory.   Line six, blank line. Line seventh below: status monitoring of each process (task), the project column information is described as follows: pid-process ID user-Process Owner         pr-process priority Ni-nice value. A negative value represents a high priority, and a positive value represents the total amount of virtual memory used by the low-priority virt-process, in kilobytes. Virt=swap+res The amount of physical memory, in kilobytes, that is used by the res-process and not swapped out. Res=code+data shr-Shared memory size, in kilobytes per KB s-process state. d= non-disruptive sleep state r= run s= sleep t= track/stop z= zombie process%cpu-Last update to current CPU time consumption percent%mem-process uses the percentage of physical memory time+-process used by CP    U time Total, units 1/100 sec command-process Name (command name/command line)

2014-09-01

Watch periodic execution program, and full-screen display of execution knot (execute a programs periodically, showing output fullscreen) parameters:-N or--interval  Watch defaults to run the program every 2 seconds, you can use-N or-interval to specify the time interval. -D or--differences  use the-D or--differences option Watch to highlight the changed area. The-d=cumulative option highlights the changes that have been made (regardless of the recent change). Example I: 1. Watch-n 1-d  Date Highlights time changes per second 2. Watch-n 1-d  ' ls-al ' highlights the changes in the directory file per second

One Linux command per day (September)

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.