在Linux系统中,我们可以通过一些命令来获取硬件的详细信息,这些信息包括CPU、内存、硬盘、网络等,以下是几个常用的获取硬件详细信息的命令。
1、lscpu:这个命令可以显示关于CPU架构的信息,包括型号、核心数、线程数等,输入lscpu后,会显示如下信息:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 142
Model name: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
Stepping: 10
CPU MHz: 810.000
CPU max MHz: 4000.0000
CPU min MHz: 4000.0000
BogoMIPS: 3987.99
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 4096K
NUMA node0 CPU(s): 0-3
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdt_aware smap clflushopt intel_pt ibrs ibpb avx512f avx512dq rdseed adx smap clwb intel_pt sha_ni avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp iopl ibrs_enhanced tpr_shadow nrip_save vgif overflow_recov succor cpb invpcid_single pni cqm qosmcp pcid mfds nopl xsave optout dern kvm clrng avic vmdflush flush_l1d
2、free:这个命令可以显示系统的内存使用情况,输入free -h后,会显示如下信息: total used free shared buff/cache available Mem: 7.7G 3.3G 987M 1.3G 3.5G 4.4G Swap: 2.0G 1.3G 677M 3、df:这个命令可以显示磁盘的使用情况,输入df -h后,会显示如下信息: Filesystem Size Used Avail Use% Mounted on /dev/sda1 50G 15G 34G 31% / tmpfs 7.9G 0 7.9G 0% /dev/shm /dev/sda6 98M 78M 22M 83% /boot /dev/sda5 976M 78M 889M 8% /run tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup /dev/sda3 5.9G 3.5G 2.5G 61% /home /dev/sda2 97M 56M 42M 58% /tmp /dev/sda7 889M 16M 873M 2% /var/run tmpfs 1.4G 0 1.4G 0% /var/lock /dev/sda4 187M 56M 129M 31% /lib/init/rw tmpfs 7.9G 0 7.9G 0% /var/lib/schroot/mount /dev/sda8 187M 0 187M 0% /dev/shm /dev/sda9 9.8G 6.4G 3.5G 66% /var/log tmpfs 7.9G 0 7.9G 0% /var/log/audit tmpfs 7.9G 0 7.9G 0% /var/log/journal tmpfs 1.4G 0 1.4G 0% /var/tmp 4、ifconfig:这个命令可以显示网络接口的信息,输入ifconfig后,会显示如下信息:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a00:27ff:fe3c:c4a9 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:3c:c4:a9 txqueuelen 1000 (Ethernet)
RX packets 3234 bytes 246868 (246.8 Kb)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 354 bytes 4548 (4.5 Kb)
TX errors 0 dropped
原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/334609.html