如果出于解决问题的目的,你想要和别人分享 top 命令的输出,请使用以下命令重定向输出到文件中:
# top -bc | head -35 > top-report.txt -
# cat top-report.txt -
top - 06:47:11 up 8 days, 20:30, 1 user, load average: 0.67, 0.77, 0.81 Tasks: 133 total, 4 running, 129 sleeping, 0 stopped, 0 zombie %Cpu(s): 59.4 us, 12.5 sy, 0.0 ni, 28.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 3880940 total, 1596268 free, 843284 used, 1441388 buff/cache KiB Swap: 1048572 total, 514640 free, 533932 used. 2659084 avail Mem -
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 9686 daygeekc 20 0 406132 62184 43448 R 94.1 1.6 0:00.34 /opt/cpanel/ea-php56/root/usr/bin/php-cgi 9689 nobody 20 0 256588 24428 1184 S 5.9 0.6 0:00.01 /usr/sbin/httpd -k start 1 root 20 0 191144 2800 1596 S 0.0 0.1 5:43.79 /usr/lib/systemd/systemd --switched-root --system --deserialize 22 2 root 20 0 0 0 0 S 0.0 0.0 0:00.32 [kthreadd] 3 root 20 0 0 0 0 S 0.0 0.0 0:28.11 [ksoftirqd/0] 5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 [kworker/0:0H] 7 root rt 0 0 0 0 S 0.0 0.0 0:33.96 [migration/0] 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 [rcu_bh] 9 root 20 0 0 0 0 R 0.0 0.0 63:05.82 [rcu_sched] 10 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 [lru-add-drain] 11 root rt 0 0 0 0 S 0.0 0.0 0:08.79 [watchdog/0] 12 root rt 0 0 0 0 S 0.0 0.0 0:08.82 [watchdog/1] 13 root rt 0 0 0 0 S 0.0 0.0 0:44.28 [migration/1] 14 root 20 0 0 0 0 S 0.0 0.0 1:22.46 [ksoftirqd/1] 16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 [kworker/1:0H] 18 root 20 0 0 0 0 S 0.0 0.0 0:00.01 [kdevtmpfs] 19 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 [netns] 20 root 20 0 0 0 0 S 0.0 0.0 0:01.35 [khungtaskd] 21 root 0 -20 0 0 0 S 0.0 0.0 0:00.02 [writeback] 22 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 [kintegrityd] 23 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 [bioset] 24 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 [kblockd] 25 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 [md] 26 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 [edac-poller] 33 root 20 0 0 0 0 S 0.0 0.0 1:19.07 [kswapd0] 34 root 25 5 0 0 0 S 0.0 0.0 0:00.00 [ksmd] 35 root 39 19 0 0 0 S 0.0 0.0 0:12.80 [khugepaged] 36 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 [crypto]
如何按照指定字段对结果进行排序
在 top 命令的最新版本中, 按下 f 键进入字段管理界面。
(编辑:ASP站长网)
|