在Linux系统中,我们可以通过多种方式来查看服务器的硬件信息,这些信息包括CPU、内存、硬盘、网络接口等,以下是一些常用的方法:
1、使用lscpu命令
lscpu是一个用于显示CPU架构信息的命令,它可以显示CPU的类型、核心数、线程数等信息,要使用lscpu命令,只需在终端中输入以下命令:
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: 2900.000 CPU max MHz: 4100.0000 CPU min MHz: 400.0000 BogoMIPS: 5812.38 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 md_clear spec_ctrl intel_stibp flush_l1d
2、使用free命令
free命令用于显示系统中的内存使用情况,要使用free命令,只需在终端中输入以下命令:
free -h
执行后,你将看到类似以下的输出:
total used free shared buff/cache available Mem: 7.7G 3.1G 1.5G 1.9G 3.5G 3.6G Swap: 2.0G 0B 2.0G
3、使用df命令
df命令用于显示磁盘空间的使用情况,要使用df命令,只需在终端中输入以下命令:
df -h
执行后,你将看到类似以下的输出:
Filesystem Size Used Avail Use% Mounted on udev 3.9G 0 3.9G 0% /dev tmpfs 797M 9.6M 788M 2% /run /dev/sda1 50G 15G 32G 31% / tmpfs 3.9G 88M 3.8G 2% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/sdb1 916G 64G 829G 7% /mnt/datastore1 tmpfs 797M 36K 797M 1% /run/user/1000
4、使用lshw命令
lshw是一个用于显示硬件配置信息的命令,它可以显示CPU、内存、硬盘、网络接口等详细信息,要使用lshw命令,只需在终端中输入以下命令:
sudo lshw -short -C display,cpu,memory,disk,network,bios,baseboard,bridge,storage,usb,input,sound,intel-rapl,thermal,pci,firmware,interconnect,port,diskio,config,power,fan,chassis,sensor,acpi,keyboard,mouse,video,graphics,net,bootloader,biosdevname,biosversion,biosdate,uuid,assettag,partlabel,manufacturer,productname,version,serialnumber,family,modelname,stepping,romversion,systemserialnumber,assettag,partlabel,manufacturer,productname,version,serialnumber,family,modelname,stepping,romversion,systemserialnumber,assettag,partlabel,manufacturer,productname,version,serialnumber,family,modelname,stepping,romversion,systemserialnumber,assettag,partlabel,manufacturer,productname,version,serialnumber,family,modelname,stepping,romversion,systemserialnumber
执行后,你将看到类似以下的输出:
*-display UNCLAIMED description: VGA compatible controller product: Intel Corporation vendor: Intel Corporation Corporation Address (ID)0x8086 Chipset Version (ID)0xb87a Version (ID)0x0007 Familiy (ID)0x2e8e Max Data Transfer Rate (ID)Oxffffffff Port (ID)Ox4e4 Device Class (ID)Ox3e4 Subsystem Class (ID)Ox8 Oxffffffff Bus Type (ID)Oxffffffff Vendor-Dependant (ID)Oxffffffff Produced by (ID)Ox8e4 Compatible ID (ID)Ox8e4 Capabilities (ID)Oxffffffff Power Management (ID)Oxffffffff Slot Information (ID)Oxffffffff *-memory UNCLAIMED description: System memory product: Kingston Technology Company Limited Physical Memory Array (ID)Ox8f14 Error Information Correction (ID)Ox4 Oxffffffff Number Of Devices (ID)Ox1 Capacity (ID)Ox2 Total Capacity (ID)Ox3 Bank Interleave (ID)Ox4 Data Bandwidth (ID)Oxffffffff *-disk UNCLAIMED description: ATA Vendor 'Seagate' Model 'Samsung SpinPoint F4 HDD' Rev '5BQ' (SPT) Partition Sectors (ID)Oxffffffff Number Of Sectors (ID)Oxffffffff Boot Start Sector (ID)Oxffffffff Boot End Sector (ID)Oxffffffff Bios Sector (ID)Oxffffffff Bios Start Sector (ID)Oxffffffff Bios End Sector (ID)Oxffffffff *-network UNCLAIMED description: Ethernet interface physical id: O media bus info: O media specific type: O other information: O *-usb UNCLAIMED description: USB controller physical id: O bus info: O device class: O other information: O *-input UNCLAIMED ...
原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/331662.html