One linux Command every day (44): top Command
Related links:
One linux Command every day (1): ls command
Http://www.bkjia.com/ OS /201210/163049.html;
One linux Command every day (2): cd command
Http://www.bkjia.com/ OS /201210/163050.html;
One linux Command every day (3): pwd command
Http://www.bkjia.com/ OS /201210/16.02.html;
One linux Command every day (4): mkdir command
Http://www.bkjia.com/ OS /201210/163163.html;
One linux Command every day (5): rm command
Http://www.bkjia.com/ OS /201210/16.02.html;
One linux Command (6) every day: rmdir command
Http://www.bkjia.com/ OS /201210/164017.html;
One linux Command (7) every day: mv command
Http://www.bkjia.com/ OS /201210/16.07.html;
One linux Command every day (8): cp command
Http://www.bkjia.com/ OS /201210/163164.html;
One linux Command every day (9): touch command
Http://www.bkjia.com/ OS /201211/165699.html;
One linux Command every day (10): cat command
Http://www.bkjia.com/ OS /201211/165989.html;
One linux Command every day (11): nl command
Http://www.bkjia.com/ OS /201211/165990.html
One linux Command every day (12): more command
Http://www.bkjia.com/ OS /201211/165994.html
One linux Command every day (13): less command
Http://www.bkjia.com/ OS /201211/165998.html
One linux Command every day (14): head command
Http://www.bkjia.com/ OS /201211/166191.html
One linux Command every day (15): tail command
Http://www.bkjia.com/ OS /201211/168702.html
One linux Command every day (16): which command
Http://www.bkjia.com/ OS /201211/168890.html
A linux Command (17) every day: whereis command
Http://www.bkjia.com/ OS /201211/168893.html
One linux Command (18) every day: locate command
Http://www.bkjia.com/ OS /201211/168895.html
One linux Command every day (19): find command Overview
Http://www.bkjia.com/ OS /201211/168897.html
One linux Command every day (20): find command exec
Http://www.bkjia.com/ OS /201211/168901.html
One linux Command (21) every day: find command xargs
Http://www.bkjia.com/ OS /201211/168903.html
A linux Command (22) every day: Detailed description of the parameters of the find command
Http://www.bkjia.com/ OS /201211/168912.html
A linux Command (23) every day: Linux directory structure
Http://www.bkjia.com/ OS /201211/170430.html
One linux Command every day (24): Linux file type and extension
Http://www.bkjia.com/ OS /201211/170431.html
One linux Command every day (25): Explanation of linux File Attributes
Http://www.bkjia.com/ OS /201211/170434.html
One linux Command every day (26): Use SecureCRT to upload and download files
Http://www.bkjia.com/ OS /201211/172022.html
One linux Command every day (27): linux chmod command
Http://www.bkjia.com/ OS /201211/172028.html
One linux Command every day (28): tar command
Http://www.bkjia.com/ OS /201212/172641.html
One linux Command (29) every day: chgrp command
Http://www.bkjia.com/ OS /201212/172983.html
One linux Command every day (30): chown command
Http://www.bkjia.com/ OS /201212/173239.html
A linux Command (31) every day:/etc/group file details
Http://www.bkjia.com/ OS /201212/174429.html
One linux Command (32) every day: gzip command
Http://www.bkjia.com/ OS /201212/174431.html
One linux Command every day (33): df command
Http://www.bkjia.com/ OS /201212/174434.html
One linux Command every day (34): du command
Http://www.bkjia.com/ OS /201212/174701.html
One linux Command (35) every day: ln command
Http://www.bkjia.com/ OS /201212/174993.html
One linux Command (36) every day: diff command
Http://www.bkjia.com/ OS /201212/176333.html
One linux Command (37) every day: date command
Http://www.bkjia.com/ OS /201212/176335.html
One linux Command (38) every day: cal command
Http://www.bkjia.com/ OS /201212/176337.html
One linux Command (39) every day: grep command
Http://www.bkjia.com/ OS /201212/177059.html
One linux Command every day (40): wc command
Http://www.bkjia.com/ OS /201212/177343.html
One linux Command every day (41): ps command
Http://www.bkjia.com/ OS /201212/177665.html
One linux Command every day (42): kill command
Http://www.bkjia.com/ OS /201212/177686.html
One linux Command every day (43): killall command
Http://www.bkjia.com/ OS /201212/178264.html top Command is a common performance analysis tool in Linux, which can display the resource usage of various processes in the system in real time, similar to the Windows Task Manager. The following describes how to use it. Top is a dynamic display process. You can press the buttons to refresh the current status. if you execute this command on the foreground, it excludes the foreground until the user terminates the program. more accurately, the top command provides real-time monitoring of the status of the system processor. it displays the list of CPU-sensitive tasks in the system. this command can be used by CPU. the memory usage and execution time are used to sort tasks. Many features of this command can be set through interactive commands or in a custom file. www.2cto. com1. Command Format: top [parameter] 2. command: displays information about the processes being executed by the system, including the process ID, memory usage, and CPU usage. command parameters: -Batch B-c display complete governance command-I ignore invalidation process-s confidentiality mode-S accumulation mode-I <time> set interval-u <User Name> specify user name- p <process number> specified process-n <times> Number of cycles displayed 4. use instance: instance 1: Display Process Information command: top output: [root @ TG1704 log] # topto P-14:06:23 up 70 days, 2 users, load average: 1.25, 1.32, 1.35 Tasks: 206 total, 1 running, 205 sleeping, 0 stopped, 0 zombieCpu (s ): 5.9% us, 3.4% sy, 0.0% ni, 90.4% id, 0.0% wa, 0.0% hi, 0.2% si, 0.0% stMem: 32949016 k total, 14411180 k used, 18537836 k free, 169884 k buffersSwap: 32764556 k total, 0 k used, 32764556 k free, 3612636 k cached pid user pr ni virt res shr s % CPU % mem time + COMMAND28894 root 22 0 1501 m 405 m 10 m S 52.2 1.3: 16 java18249 root 18 0 2534 m 3201g 11 m S 1.9 35.9 6.0: 39.41 java2808 root 25 0 3333 m 1.0g 11 m S 24.3 3.1 526: 51.85 java25668 root 23 0 3180 m 704 m 11 m S 14.0 2.2 360: 44.53 java574 root 25 0 3168 m 611 m 10 m S 12.6 1.9: 556 java1599 root 20 0 59.63 m 3237g 11 m S 1.9 12.3 6.2: 01.14 java1008 root 21 0 3147 m 842 m 10 m S 0.3. 08 java13823 root 23 0 3031 m 2.1g 1 0 m S 0.3 6.8 176: 57.34 java28218 root 15 0 12760 1168 R 808 0.3. 43 top29062 root 20 0 1241 m 227 m 10 m S 0.3. 32 java1 root 15 0 10368 684 S 572 0.0. 85 init2 root RT-5 0 0 0 S 0.0 0.0. 01 migration/03 root 34 19 0 0 0 S 0.0 0.0. 00 ksoftirqd/04 root RT-5 0 0 0 S 0.0 0.0. 00 watchdog/05 root RT-5 0 0 0 S 0.0 0.0. 80 migration/16 root 34 19 0 0 S 0.0 0.0 0: 00. 00 ksoftirqd/17 root RT-5 0 0 0 S 0.0 0.0. 00 watchdog/18 root RT-5 0 0 0 S 0.0 0: 20. 59 migration/29 root 34 19 0 0 S 0.0 0.0. 09 ksoftirqd/210 root RT-5 0 0 0 S 0.0 0: 00. 00 watchdog/211 root RT-5 0 0 0 S 0.0 0: 23. 66 migration/312 root 34 19 0 0 0 S 0.0 0.0. 03 ksoftirqd/313 root RT-5 0 0 0 S 0.0 0.0. 00 watchdog/314 root RT-5 0 0 0 S 0.0 0: 20. 29 migrat Ion/415 root 34 19 0 0 0 S 0.0 0: 00. 07 ksoftirqd/416 root RT-5 0 0 0 S 0.0 0.0. 00 watchdog/417 root RT-5 0 0 0 S 0.0 0: 23. 07 migration/518 root 34 19 0 0 0 S 0.0 0.0. 07 ksoftirqd/519 root RT-5 0 0 0 S 0.0 0.0. 00 watchdog/520 root RT-5 0 0 0 S 0.0 0: 17. 16 migration/621 root 34 19 0 0 S 0.0 0.0. 05 ksoftirqd/622 root RT-5 0 0 0 S 0.0 0.0. 00 watchdog/623 roo T RT-5 0 0 0 S 0.0 0.0. 28 migration/7 Description: Statistical Information area: the first five rows are the overall statistical information area of the current system. Next we will look at the specific meaning of each line of information. The first line is the task queue information, which is the same as the execution result of the uptime command. The specific parameters are described as follows: 14: 06: 23-the current system time is up for 70 days, -The system has been running for 70 days, 16 hours, and 44 minutes (during this period, the system has not restarted the crash !) 2 users-currently there are two users logging on to the system load average: 1.15, 1.42, 1.44-load average. The three numbers after the average are 1 minute, 5 minutes, and 15 minutes respectively. The load average data checks the number of active processes every five seconds and then calculates the value based on a specific algorithm. If this number is divided by the number of logical CPUs, the system is overloaded when the result is higher than 5. The second line is Tasks-task (process). The details are described as follows: the system currently has 206 processes, of which 1 is running and 205 are sleep ), there are 0 stoped states and 0 zombie states (botnets. The third line shows the cpu status information. The specific attributes are described as follows: 5.9% us-Percentage of CPU occupied by user space. 3.4% sy-Percentage of CPU occupied by kernel space. 0.0% ni-Percentage of CPU used by processes that have changed their priorities 90.4% id-Percentage of idle CPU 0.0% wa-IO percentage of CPU occupied 0.0% hi-hard interrupt (Hardware IRQ) CPU usage 0.2% si-Soft Interrupt (Software Interrupts) CPU usage percentage remarks: here the CPU usage rate is different from the windows concept, understanding about linux user space and kernel space! Row 4: memory status. Details: 32949016 k total-total physical memory (32 GB) 14411180 k used-total memory in use (14 GB) 18537836 k free-total idle memory (18 GB) 169884 k buffers-cache memory (169 MB) the fifth line, swap partition information, details are described as follows: 32764556 k total-total swap areas (32 GB) 0 k used-total number of swap areas used (0 K) 32764556 k free-total number of idle swap areas (32 GB) 3612636 k cached-buffer swap zone total (3.6 GB) Remarks: The total memory used in row 4 refers to the number of memories currently controlled by the system kernel, the total idle memory (free) is the number of cores not included in the control scope. The memory included in the kernel management is not always in use, but also the memory that can be reused in the past, the kernel does not return the reusable memory to free. Therefore, free memory will become fewer and fewer on linux, but you don't have to worry about it. If you calculate the number of available memory out of habit, there is an approximate formula: free in the fourth row + buffers in the fourth row + cached in the fifth row, according to this formula, the available memory of this server is about 18537836 k + 169884 k + 3612636 k = 22 GB. For memory monitoring, we need to monitor the used of the fifth-line swap partition in top. If this value is constantly changing, it means that the kernel is constantly exchanging data between memory and swap, this is the real insufficient memory. The sixth line is empty. The seventh line is the status monitoring of each process (task). The project column information is described as follows: PID-process idUSER-process owner PR-process priority NI-nice value. A negative value indicates a high priority. A positive value indicates a low priority VIRT-Total virtual memory used by the process, in kb. VIRT = SWAP + RESRES-physical memory used by the process, not swapped out, in kb. RES = CODE + DATASHR-shared memory size, in kbS-Process status. D = non-disruptive sleep state R = running S = sleep T = tracking/stopping Z = zombie process % CPU-Percentage of CPU time occupied since the last update % MEM-Process Used physical memory percentage TIME +-total cpu time used by the process, unit: 1/100 seconds COMMAND-process name (COMMAND name/COMMAND line) Other tips: 1. multi-U multi-core CPU monitoring in the top basic view, press the keyboard number "1" to monitor the status of each logical CPU: observe that the server has 16 logical CPUs, actually four physical CPUs. Press the number key 1 to return to the top basic view interface. 2. highlight the current running process and press "B" on the keyboard (enable/disable the highlighted effect). The top view changes as follows: we find that the "top" process with the process id of 2570 is highlighted, the top process is the only runing process displayed on the second line of the view. You can press the "y" key to close or enable the brightening effect of the running process. 3. by default, process fields are sorted by CPU usage. java processes with a process ID of 28894 rank first (cpu usage of 142% ), java processes with a process ID of 574 rank second (cpu usage: 16% ). Press "x" on the keyboard (enable or disable the highlight effect of the sorting column). The top view changes as follows: You can see that the top default sorting column is "% CPU ". 4. You can use "shift +>" or "shift + <" to change the order column to the right or left by "shift +>". The view is now sorted by % MEM. Instance 2: Display complete command: top-c output: Note: instance 3: display program information in batch mode command: top-B output: Note: instance 4: run the "top-S output" command to display program information in the accumulative mode. Note: instance 5: set the number of information updates. Run the command "top-n 2". The output is described as follows: indicates to terminate the update display instance after two updates 6: Set the Information Update Time Command: top-d 3 output: Note: indicates that the update cycle is 3 seconds for instance 7: command: top-p 574 output: Description: 5. some interactive commands that can be used during top command execution. These commands are single-letter. If the s option is used in the command line, some of these commands may be blocked. H. The help screen is displayed, and some brief command summaries are provided to explain that k terminates a process. I ignore idle and dead processes. This is a switch-on command. Q exit program r reschedule the priority S of a process to switch to the cumulative Mode s to change the delay time between two refreshes (unit: s). If there is a decimal number, it is converted to m s. If the input value is 0, the system will continue to refresh, the default value is 5 sf or F. add or delete a project from the current display. o or O changes. display the order of items. l switch. display average load and start time. m switch. Display memory information. t switch. display process. and CPU status information c switch display command name and complete command line M sort by resident memory size P sort by CPU usage percentage T sort by time/accumulative time W set the current write ~ /. Toprc File