Linux Shell查看CPU核心数

1.CPU物理处理器数

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

2.CPU核心数

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

3.CPU逻辑数

1
cat /proc/cpuinfo | grep "processor" | sort | uniq | wc -l

过滤目录下文件所包含的某个字段

1
2
3
4
5
find ./  -type f | xargs grep "docker-registry.default.svc" | awk '{gsub(":"," ");print $1}'

find ./ -type f | xargs grep "docker-registry.default.svc" | awk '{gsub(" "," ");print $1}'

find ./ -type f | xargs grep "docker-registry.default.svc" | awk '{gsub(" ","");print $1}'
-------------本文结束感谢您的阅读-------------