PS command can only current query the status of the process, the top command can view the status of the process in real-time, and the top command can follow the CPU, memory, execution time and other indicators to sort the process
[Email protected]_228 ~]# toptop- One: the: theUp -Days +: -,1User, load Average:0.21,0.26,0.16Tasks:113Total1Running111Sleeping,0Stopped1Zombiecpu (s):0.2%us,0.2%sy,0.0%ni,99.5%ID,0.0%wa,0.0%hi,0.2%si,0.0%stmem:2059568k Total, 1179992k used, 879576k Free, 15620k buffersswap:0k Total, 0k used, 0k Free, 48784k cached PID USER PR NI VIRT RES SHR S%CPU%MEM time+COMMAND 1667Root the 0 95308 1756 560S0.3 0.1 8:47.93redis-Server 2137Root the 0101m9584 844S0.3 0.5 4:45.38redis-Server 4009Root - 0228m 57m1892S0.3 2.9 +:14.25BEAM.SMP 1Root the 0 10360 168 -S0.0 0.0 0:02.77Init 2Root RT-5 0 0 0S0.0 0.0 0:26.09migration/0 3Root the + 0 0 0S0.0 0.0 0:02.80ksoftirqd/0 4Root RT-5 0 0 0S0.0 0.0 0:00.00watchdog/0 5Root RT-5 0 0 0S0.0 0.0 0:12.84migration/1 6Root the + 0 0 0S0.0 0.0 0:00.46ksoftirqd/1 7Root RT-5 0 0 0S0.0 0.0 0:00.00watchdog/1 8RootTen-5 0 0 0S0.0 0.0 0:03.63events/0 9RootTen-5 0 0 0S0.0 0.0 0:00.54events/1 TenRootTen-5 0 0 0S0.0 0.0 0:00.00Khelper -Root One-5 0 0 0S0.0 0.0 0:00.00Kthread +RootTen-5 0 0 0S0.0 0.0 0:00.30kblockd/0 -RootTen-5 0 0 0S0.0 0.0 0:00.10kblockd/1 theRoot --5 0 0 0S0.0 0.0 0:00.00Kacpid 133Root --5 0 0 0S0.0 0.0 0:00.00cqueue/0 134Root the-5 0 0 0S0.0 0.0 0:00.00cqueue/1 137RootTen-5 0 0 0S0.0 0.0 0:00.00KHUBD 139RootTen-5 0 0 0S0.0 0.0 0:00.00Kseriod 211Root the 0 0 0 0S0.0 0.0 0:00.02Khungtaskd
View Code
A few useful information
%id Idle CPU Percentage
WA wait percent
Custom Display content:
Press the "F" key in the top display screen
The default top is sorted by CPU usage, and the sort selection is entered by the capital letter "O"
Shortcut keys:
"P" is sorted by CPU usage
"M" is sorted by memory utilization
"N" is sorted by PID
"T" is sorted by CPU usage time
"K" kills a process
The Linux top command