如何查看哪些进程占用的CPU内存资源最多

linux下获取占用CPU资源最多的10个进程,可以使用如下命令组合:

ps aux|head -1;ps aux|grep -v PID|sort -rn -k +3|head

[root@dev76 deploy]# ps aux|head -1;ps aux|grep -v PID|sort -rn -k +3|head
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     26311 95.3  0.0      0     0 ?        R    Jun19 2508:20 [acpi_pad/30]
root     26310 95.3  0.0      0     0 ?        R    Jun19 2508:22 [acpi_pad/29]
root     26309 95.3  0.0      0     0 ?        R    Jun19 2508:22 [acpi_pad/28]
root     26308 95.3  0.0      0     0 ?        R    Jun19 2508:23 [acpi_pad/27]
root     26307 95.3  0.0      0     0 ?        R    Jun19 2508:21 [acpi_pad/26]
root     26306 95.3  0.0      0     0 ?        R    Jun19 2508:24 [acpi_pad/25]
root     26305 95.3  0.0      0     0 ?        R    Jun19 2508:25 [acpi_pad/24]
root     26304 95.3  0.0      0     0 ?        R    Jun19 2508:21 [acpi_pad/23]
root     26303 95.3  0.0      0     0 ?        R    Jun19 2508:27 [acpi_pad/22]
root     26302 95.3  0.0      0     0 ?        R    Jun19 2508:22 [acpi_pad/21]

获取占用内存资源最多的进程:

ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head -2

[root@dev76 deploy]# ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head -2
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     28523  5.8 15.5 26617220 10206148 ?   Ssl  Jun18 267:25 java -jar data-sync.jar
root     28434  1.5 13.0 27760872 8602084 ?    Ssl  Jun18  70:01 java -jar ROOT_COMMAND.jar

你可能感兴趣的:(如何查看哪些进程占用的CPU内存资源最多)