centos服务器如何用命令查看哪个程序内存占用情况,硬盘空间占用
1.free -m只能查看内存总量情况
2.top M ( 注意M是大写)
3.ps aux|head -1; ps aux | sort -k4nr | head -10
---------------------
硬盘占用
df -lh
(查看文件占用)
du -h --max-depth=1
(查看删除占用)
lsof -n | grep deleted
查看日志
tail -1 /var/log/boot.log
可以使用一下命令查使用内存最多的5个进程
ps -aux | sort -k4nr | head 5
或者
top (然后按下M,注意大写)
可以使用一下命令查使用CPU最多的5个进程
ps -aux | sort -k3nr | head 5
或者
top (然后按下P,注意大写)
转载自:https://www.cnblogs.com/sos-blue/p/7101473.html, https://blog.youkuaiyun.com/MatrixGod/article/details/82689624