linux系统检测

系统版本

hostnamectl

image

CPU型号

cat /proc/cpuinfo | grep "model name" | uniq

image

CPU数量

cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l

image

单个CPU的核心数量

lscpu | grep "^Core(s)"
grep 'core id' /proc/cpuinfo | sort -u |wc -l

image

CPU线程数

没法查单个cpu的线程数,只能查到总的,如果是2块cpu,就除以2

grep 'processor' /proc/cpuinfo | sort -u | wc -l

image

查看系统CPU信息

lscpu

image

查看CPU占用情况

top

image
image
image
image
image

查看系统内存占用

free -h

image
Mem为内存情况

查看硬盘占用

df -h

image

查看路径下所有文件总大小

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

image
image

posted @ 2024-01-20 14:32  精神病人王大夫  阅读(27)  评论(0编辑  收藏  举报