在linux服务器中,我们如何查看cpu占用最高的进程
>ps aux|head -1;ps aux|grep -v PID|sort -rn -k +3|head
```
[root@iZbp1fna7ky0qz2jbj7gfpZ wwwlogs]# 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 1371 1.3 1.7 138184 18124 ? S
```
[root@iZbp1fna7ky0qz2jbj7gfpZ wwwlogs]# ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
mysql 2059 0.0 27.2 922080 276796 ? Sl 15:54 0:12 /www/server/mysql/bin/mysqld --basedir=/www/server/mysql --datadir=/www/server/data --plugin-dir=/www/server/mysql/lib/plugin --user=mysql --sql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION --log-error=iZbp1fna7ky0qz2jbj7gfpZ.err --open-files-limit=65535 --pid-file=/www/server/data/iZbp1fna7ky0qz2jbj7gfpZ.pid --socket=/tmp/mysql.sock --port=3306
root 1614 0.0 5.1 406760 51752 ? Sl 15:54 0:04 /www/server/panel/pyenv/bin/python /www/server/panel/BT-Panel
root 1476 0.0 3.3 868820 34084 ? Sl 15:53 0:18 /www/server/panel/pyenv/bin/python /www/server/panel/BT-Task
root 566 0.0 3.2 363100 32484 ? Ssl 15:53 0:01 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid
www 1295 0.0 2.8 232784 28636 ? S 15:53 0:02 php-fpm: pool www
www 2229 0.0 2.7 232096 27768 ? S 15:54 0:02 php-fpm: pool www
www 1304 0.0 2.6 216072 27320 ? S 15:53 0:00 nginx: worker process
www 1294 0.0 2.5 229660 25696 ? S 15:53 0:02 php-fpm: pool www
www 1292 0.0 2.2 227656 22908 ? S 15:53 0:02 php-fpm: pool www
www 1293 0.0 1.9 229496 19736 ? S 15:53 0:02 php-fpm: pool www
```