参考自:
https://www.binarytides.com/linux-commands-hardware-info/
https://www.binarytides.com/linux-lshw-command/
以 CentOS 为例,安装 lshw:
yum install lshw
然后运行:
sudo lshw -short
太长可以根据需要,显示部分硬件信息:
# 内存 lshw -short -class memory # CPU lshw -class processor # 磁盘 lshw -short -class disk -class storage -class volume #网络 lshw -class network #输出报告 lshw -html > hardware.html
查看磁盘占用:
df -H
查看 CPU 和内存占用:
top