查看硬件基本信息
一、查看CPU信息
点击查看代码
[root@node-exporter41 ~]# lscpu
Architecture: x86_64 #表示这是64位x86架构的CPU
CPU op-mode(s): 32-bit, 64-bit #32-bit, 64-bit,表示支持32位和64位模式
Address sizes: 45 bits physical, 48 bits virtual #45位物理地址,48位虚拟地址。这表示CPU可以访问的物理内存大小和虚拟内存大小
Byte Order: Little Endian
CPU(s): 4 #表示系统有4个逻辑CPU(即4个线程)
On-line CPU(s) list: 0-3 #0-3,表示这4个逻辑CPU都在线
Vendor ID: AuthenticAMD #AuthenticAMD,表示是AMD的CPU
Model name: AMD Ryzen 7 4800H with Radeon Graphics #这是AMD的一款移动处理器,带有集成显卡
CPU family: 23 #这是AMD Zen2架构的家族编号
Model: 96 #具体型号编号
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 4
Stepping: 1
BogoMIPS: 5789.13
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2
syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc
cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt
aes xsave avx f16c rdrand hypervisor lahf_lm extapic cr8_legacy abm sse4a misalignsse 3dnowprefet
ch osvw topoext ssbd ibrs ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt cl
wb sha_ni xsaveopt xsavec xgetbv1 clzero wbnoinvd arat umip rdpid overflow_recov succor
Virtualization features:
Hypervisor vendor: VMware
Virtualization type: full
Caches (sum of all):
L1d: 128 KiB (4 instances) #128 KiB(数据缓存,4个实例)
L1i: 128 KiB (4 instances) #128 KiB(指令缓存,4个实例)
L2: 2 MiB (4 instances) #2 MiB(4个实例)
L3: 16 MiB (4 instances) #16 MiB(4个实例)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-3
Vulnerabilities:
Gather data sampling: Not affected
Indirect target selection: Not affected
Itlb multihit: Not affected
L1tf: Not affected
Mds: Not affected
Meltdown: Not affected
Mmio stale data: Not affected
Reg file data sampling: Not affected
Retbleed: Mitigation; untrained return thunk; SMT disabled
Spec rstack overflow: Mitigation; SMT disabled
Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Spectre v2: Mitigation; Retpolines; IBPB conditional; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected;
BHI Not affected
Srbds: Not affected
Tsa: Not affected
Tsx async abort: Not affected
Vmscape: Not affected
[root@node-exporter41 ~]#
二、查看内存
点击查看代码
[root@node-exporter41 ~]# free
total used free shared buff/cache available
Mem: 1973928 310140 1313196 1312 350592 1499792
Swap: 2097148 0 2097148
#第一部分物理内存(Mem)
#total:总内存 = 1,973,928 KB ≈ 1.88 GB
#used:已使用内存 = 310,140 KB ≈ 302 MB (包括应用程序使用的内存和部分缓存)
#free:空闲内存 = 1,313,196 KB ≈ 1.25 GB (当前完全未被使用的内存)
#shared:共享内存 = 1,312 KB ≈ 1.3 MB (多个进程共享的内存(如tmpfs))
#buff/cache:缓冲/缓存内存 = 350,592 KB ≈ 342 MB(buffer:磁盘写缓存)(cache:文件系统缓存(这部分在需要时可以被释放))
#available:可用内存 = 1,499,792 KB ≈ 1.43 GB (最关键指标!系统估算的、可以立即分配给新进程的内存)(= free + buff/cache可释放部分 + 其他可回收内存)
#第二部分交换分区(Swap)
#total:总交换空间 = 2,097,148 KB ≈ 2 GB
#used:已使用 = 0 KB
#free:空闲 = 2,097,148 KB
#建议
#如果available内存低于总内存的10%才需要考虑优化
#你还可以使用 free -h 查看人类可读格式,或 vmstat、top 进一步分析
三、查看硬盘信息
点击查看代码
#基本磁盘空间查看
#df - 查看文件系统磁盘空间使用情况
df -h # 最常用,人类可读格式
df -Th # 显示文件系统类型
df -i # 显示inode使用情况
df -h -t ext4 # 只显示特定文件系统(如ext4)
#du - 查看目录/文件磁盘使用情况
du -h --max-depth=1 # 查看当前目录各子目录大小
du -sh /path/to/directory # 查看指定目录总大小
du -h --max-depth=1 | sort -hr # 按大小排序显示目录
#磁盘和分区信息
#lsblk - 列出块设备(最常用)
lsblk #查看所有磁盘和分区(树状结构)
lsblk -f #显示详细信息(包括UUID、挂载点等)
lsblk -m # 显示所有信息,包括权限、所有者
lsblk -S # 显示SCSI地址和类型
#fdisk - 磁盘分区表查看工具
fdisk -l # 查看所有磁盘分区表
fdisk -l /dev/sda # 查看指定磁盘
#parted - 高级分区工具
parted -l # 查看磁盘分区信息
parted /dev/sda print # 交互模式查看特定磁盘
四、查看网卡名称
点击查看代码
[root@node-exporter41 ~]# apt-get install -y net-tools
[root@node-exporter41 ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.41 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::20c:29ff:fe10:1eef prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:10:1e:ef txqueuelen 1000 (Ethernet)
RX packets 34600 bytes 13806456 (13.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 19861 bytes 19809864 (19.8 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens34: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.1.41 netmask 255.255.255.0 broadcast 172.16.1.255
inet6 fe80::20c:29ff:fe10:1ef9 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:10:1e:f9 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 16 bytes 1216 (1.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 112 bytes 10138 (10.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 112 bytes 10138 (10.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@node-exporter41 ~]#
本文来自博客园,作者:晴天哈哈哈1,转载请注明原文链接:https://chuna2.787528.xyz/qiangtian812/p/19577802

浙公网安备 33010602011771号