原文链接:https://blog.csdn.net/qq_31024823/article/details/84821064
https://www.cnblogs.com/hapday/p/6336905.html
1.查看硬盘
[mushme@investide ~]$ df -ah
文件系统 容量 已用 可用 已用% 挂载点
/dev/cciss/c0d0p1 123G 63G 55G 54% /
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
devpts 0 0 0 - /dev/pts
tmpfs 2.0G 0 2.0G 0% /dev/shm
none 0 0 0 - /proc/sys/fs/binfmt_misc
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs
nfsd 0 0 0 - /proc/fs/nfsd
查看目录大小
du -sh /project
2.查看内存
[mushme@investide ~]$ free -m
total used free shared buffers cached
Mem: 3916 3281 634 0 135 1858
-/+ buffers/cache: 1287 2628
Swap: 10000 235 9765
或者用下面这个命令
cat /proc/meminfo
3.查看cpu
[mushme@investide ~]$ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
8 Intel(R) Xeon(R) CPU E5506 @ 2.13GHz
说明是8个逻辑cpu
[mushme@investide ~]$ cat /proc/cpuinfo | grep physical | uniq -c
4 physical id : 0
4 physical id : 1
实际是2个cpu
[mushme@investide ~]$ getconf LONG_BIT
32
当前cpu运行在32位下
[mushme@investide ~]$ cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
8
(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)
再完整看cpu详细信息, 不过大部分我们都不关心而已.
# dmidecode | grep 'Processor Information'
4.查看当前操作系统内核信息
[mushme@investide ~]$ uname -a
Linux investide.cn 2.6.18-238.9.1.el5PAE #1 SMP Tue Apr 12 18:52:55 EDT 2011 i686 i686 i386 GNU/Linux
5.查看网卡信息
# dmesg | grep -i eth
6.查看系统
cat /etc/issue
1、查看 CPU 物理个数
grep 'physical id' /proc/cpuinfo | sort -u | wc -l
2、查看 CPU 核心数量
grep 'core id' /proc/cpuinfo | sort -u | wc -l
3、查看 CPU 线程数
grep 'processor' /proc/cpuinfo | sort -u | wc -l
4、查看 CPU 型号
dmidecode -s processor-version
5、查看 CPU 的详细信息:
cat /proc/cpuinfo