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

How to get started with Linux top commands

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

How to get started with Linux top command? for this question, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

The top command is used to monitor the usage of system resources in real time, including processes, cpu, memory, etc.

1. Usage

Top [options]

2. Command options

-b operate in batch mode-c display complete governance command-d screen refresh interval time-I ignore failure process-s secret mode-S cumulative mode-I set refresh interval time-u specify user name-p specify process-number of times that n loop display

3. Keyboard shortcuts are often used in this command

H display shortcuts help k terminate a process I turn on / off ignore idle and dead processes Q exit program r reschedule a process's priority S switch to cumulative mode s change refresh interval Add or remove items o from the current display O change the order in which items are displayed l toggle 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 sort by memory usage P sort by CPU usage (default sort ) T sorts by time / cumulative time w writes the current settings to the ~ / .toprc file to expand the multicore cpu display

4. Examples

Top-18:17:22 up 8:52, 1 user, load average: 0.05,0.04, 0.05Tasks: 99 total, 2 running, 97 sleeping, 0 stopped, 0 zombie%Cpu (s): 0.0 us, 0.1 sy, 0.0 ni, 99.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 stKiB Mem: 739932 total, 353944 free, 125284 used, 260704 buff/cacheKiB Swap: 1044476 total, 1044476 free, 0 used. 459304 avail MemPID USER PR NI VIRT RES SHR S% CPU% MEM TIME+ COMMAND47 root 2000 00 S 0.1 0.0 kworker/0:1643 root 36.55 kworker/0:1643 root 20 21668 1284 972 S 0.1 0.2 0 irqbalance1668 root 18.13 irqbalance1668 root 20 00 S 0.1 0.0 irqbalance1668 root 01.08 kworker/1:11 root 20 0 127968 6480 4096 S 0.90 systemd2 root 20 00 S 0.0 irqbalance1668 root 00.02 kthreadd3 root 20 00 S 0.0 0.00: 00.23 ksoftirqd/05 root 0-20 000 S 0.0 0.00: 00.00 kworker/0:0H7 root rt 00 00 S 0.0 0.00: 00.02 migration/08 root 20 00 00 S 0.0 0.00: 00.00 rcu_bh9 root 20 00 R 0.0 0.00: 01.95 rcu_sched10 root 0-20 000 S 0.0 0.00: 00.00 lru-add-drain

5. Description

Overall resource statistics of the top 5 behavior systems

Top-system current time up system powered on how long user current users load average cpu average load, three values are, 1 minute, 5 minutes, 15 minutes Tasks system current processes, total: total processes, running: running processes, sleeping: sleep processes, stopped: processes stopped Zombie: number of zombie processes% Cpu (s) cpu utilization, us: user uses cpu 100%, sy: system kernel uses cpu 100%, id: remaining cpu 100% Mem memory usage information, total: total memory size, free: free memory, used: used memory Buff/cache: cached memory size Swap virtual memory information PID process idUSER process owner PR priority NI nice value, negative value indicates high priority A positive value indicates the total amount of virtual memory used by low-priority VIRT processes physical memory size used by RES processes SHR shared memory size S process state, D: uninterruptible sleep state, R: run, S: sleep, T: track / stop Z: zombie process% percentage of CPU used by CPU process% percentage of physical memory used by MEM process% percentage of CPU time used by TIME+ process total COMMAND command name the answer to the question on how to get started with Linux top commands is shared here. I hope the above content can be of some help to you, if you still have a lot of doubts to solve. You can follow the industry information channel for more related knowledge.

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