前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >shell自动获取硬件信息

shell自动获取硬件信息

原创
作者头像
小徐
发布2021-12-16 18:21:36
1.3K0
发布2021-12-16 18:21:36
举报
文章被收录于专栏:GreenplumGreenplum
代码语言:shell
复制
#!bin/bash

echo -e "------ os release ------"
cat /etc/redhat-release
cat /etc/issue | grep Linux

echo -e "\n ------ cpu physical ------"
cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l

echo -e "------ cpu info ------"
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

echo -e "------ cpu processor ------"
cat /proc/cpuinfo | grep "processor" | uniq | wc -l

echo -e "\n ------ os BIT ------"
getconf LONG_BIT
uname -m

echo -e "------ os type ------"
dmidecode |grep "Product"

echo -e "\n ------ os network ------"
ls /sys/class/net/

echo -e "------ virtual network ------"
ls /sys/devices/virtual/net/

echo -e "------ devices  network ------"
ls /sys/class/net/ | grep -v "`ls /sys/devices/virtual/net/`"


echo -e "\n ------ os free ------"
free -h

echo -e "------ os disk ------"
df -h

echo -e "------ fdisk  ------"
df -h|grep "/dev/"
fdisk -l|grep "/dev/"

echo -e "\n ------ L1d cache ------ "
lscpu | grep -i 'L1d 缓存\|L1d cache' | awk -F ':|:' '{print $2}'

echo -e "------ L1i cache ------"
lscpu | grep -i 'L1i 缓存\|L1i cache' | awk -F ':|:' '{print $2}'

echo -e "------ L2 cache ------"
lscpu | grep -i 'L2 缓存\|L2 cache' | awk -F ':|:' '{print $2}'

echo -e "------ L3 cahce ------"
lscpu | grep -i 'L3 缓存\|L3 cache' | awk -F ':|:' '{print $2}'

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档