Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the specific use of the top command on the Linux system

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article analyzes "what is the specific use of the top command on the Linux system?" The content is detailed and easy to understand. Friends who are interested in "what is the specific use of the top command in the Linux system" can follow the editor's train of thought to read it slowly and deeply. I hope it will be helpful to you after reading. Let's go deep into the knowledge of "what is the specific use of top commands in the Linux system" with the editor.

In Linux systems, the top command is often used to monitor the system status of linux, such as cpu and memory usage, but most people don't actually use this command.

First of all, let's top and check the details:

The first line shows an overview of the system: the current time, the running time of the system, the number of users logged in, and the average load of the system. The average load has three values: the last 1 minute, the last 5 minutes, and the last 15 minutes. Load average data does not check the number of active processes every 5 seconds, and then calculates the value according to a specific algorithm. If the number of CPU logic is greater than 5, it proves that the system is overloaded.

The second line shows the process: the output of the top command calls the process a task: the total process, running, dormant, stopped, or ossified (rigid means that the process completes, but the parent process does not respond).

The third line shows CPU information: top divides CPU utilization into several types of output based on the owner of the process (user or system) and the state of the process (running, idle, or waiting). 0.0%us [user space]-percentage of CPU occupied by user space. 1.5%sy [sysctl]-percentage of CPU occupied by kernel space. 0.0%ni []-percentage of CPU occupied by processes that have changed priorities 98.5% id [idolt]-percentage of idle CPU 0.0% [wait]-percentage of CPU occupied by IO waiting 0.0%hi [Hardware IRQ]-percentage of CPU occupied by hard interrupts 0.0%si [Software Interrupts]-percentage of soft interrupts occupying CPU

The fourth line shows the memory information: 3861288 total total memory 3505044 free free memory 237656 used the amount of memory that has been cached by 118588 buff/cache

The fifth line shows the swap exchange partition information: 4194300 total total size 4194300 free idle 0 used total swap area that has used 3438244 avail Mem buffers

Note: available memory = free + buffer + cached for memory monitoring, in top, we should always monitor the used of the fifth line of swap swap partition. If this value is constantly changing, it means that the kernel is constantly exchanging memory and swap data, which is really out of memory. The total amount of memory in use (used) in the fourth line refers to the amount of memory currently controlled by the system kernel, and the total amount of free memory (free) in the fourth line is the amount that the kernel does not yet control. Not all the memory managed by the kernel is in use, and it also includes memory that has been used in the past and can be reused now, and the kernel does not return the reusable memory to free, so there will be less and less free memory on linux, but don't worry about it.

Finally, a detailed list of currently running processes PID: the ID of the process is displayed. USER: the name of the process owner. PR: priority of the process. NI: the modesty value of the process. VIRT: the total amount of virtual memory consumed by the process. RES: the total amount of physical memory consumed by the process. SHR: the total amount of memory shared by processes and other processes. S: the state of the process (D stands for interruptible dormant state, R for running state, S for dormant state, T for tracking state or stopped state, Z for rigid state). % CPU: the percentage of CPU time used by the process. % MEM: the memory used by the process as a percentage of available memory. The total CPU time of TIME+: since the process was started. COMMAND: the command line name corresponding to the process, that is, the name of the program you started.

In the top base view, press numeric keypad 1 to monitor the status of each logical CPU

Other interactive commands

H displays the help screen, giving some short command summary instructions k to terminate a process.

I ignore idle and dead processes. This is a switch command.

Q exit program

R rearrange the priority of a process

S switch to cumulative mode s change the delay time between refreshes (in s)

F or F add or remove items from the current display

O or O change the order in which items are displayed

L toggle to display average load and startup time information

M toggle display memory information

T toggle display process and CPU status information

C toggle display command name and full command line

M sorts according to resident memory size

P sorts by percentage of CPU usage

T sorts by time / cumulative time W writes the current settings to the ~ / .toprc file

On the Linux system top command is the specific use of what is shared here, I hope that the above content can make you improve. If you want to learn more knowledge, please pay more attention to the editor's updates. Thank you for following the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report