linux系统检测
系统版本
hostnamectl
CPU型号
cat /proc/cpuinfo | grep "model name" | uniq
CPU数量
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
单个CPU的核心数量
lscpu | grep "^Core(s)"
grep 'core id' /proc/cpuinfo | sort -u |wc -l
CPU线程数
没法查单个cpu的线程数,只能查到总的,如果是2块cpu,就除以2
grep 'processor' /proc/cpuinfo | sort -u | wc -l
查看系统CPU信息
lscpu
查看CPU占用情况
top
查看系统内存占用
free -h
Mem为内存情况
查看硬盘占用
df -h
查看路径下所有文件总大小
du -shc /usr/local/nginx/logs
同路径下所有相似文件的总大小(求.log的所有文件大小)
du -shc /usr/local/软件路径/*.log
根据进程名或者端口号,查询pid
ps -ef | grep zookeeper
ps -aux | grep zookeeper
ps -aux | grep 2181
netstat -lnp|grep 2181
查询cpu占用率
方法一
ps -aux | grep zookeeper