文章插图
在Linux下,我们经常需要查看系统的硬件信息, 这里我罗列了查看系统硬件信息的实用命令,并做了分类,实例解说 。
执行环境:ubuntu 16.04
1. cpulscpu命令,查看的是cpu的统计信息.
[email protected]:/home/peng/# lscpuArchitecture:x86_64#cpu架构CPU op-mode(s):32-bit, 64-bitByte Order:Little Endian#小尾序CPU(s):1#总共有1核On-line CPU(s) list:0Thread(s) per core:1#每个cpu核,只能支持一个线程,即不支持超线程 Core(s) per socket:1Socket(s):1NUMA node(s):1Vendor ID:GenuineIntel#cpu产商 intelCPU family:6Model:158Model name:Intel(R) Core(TM) i5-7500 CPU @ 3.40GHzStepping:9CPU MHz:3408.070BogoMIPS:6816.14Hypervisor vendor:VMwareVirtualization type:full#支持cpu虚拟化技术L1d cache:32KL1i cache:32KL2 cache:256KL3 cache:6144KNUMA node0 CPU(s):0
查看/proc/cpuinfo,可以知道每个cpu信息,如每个CPU的型号,主频等 。[email protected]:/home/peng# cat /proc/cpuinfoprocessor : 0vendor_id : GenuineIntelcpu family : 6model: 158model name : Intel(R) Core(TM) i5-7500 CPU @ 3.40GHzstepping : 9microcode : 0x48cpu MHz: 3408.070cache size : 6144 KBphysical id : 0siblings : 1core id: 0cpu cores : 1apicid: 0initial apicid : 0fpu: yesfpu_exception : yescpuid level : 22wp: yes.....
2. 内存概要查看内存情况[email protected]:/home/peng# free -mtotalusedfreesharedbuff/cacheavailableMem:1970702315139521025Swap:97420954
这里的单位是MB,总共的内存是1970MB 。查看内存详细使用
[email protected]:/home/peng# cat /proc/meminfo MemTotal:2017516 kBMemFree:242020 kBMemAvailable:1003240 kBBuffers:104192 kBCached:699824 kBSwapCached:1832 kBActive:696320 kBInactive:639924 kBActive(anon):236412 kBInactive(anon):301996 kBActive(file):459908 kBInactive(file):337928 kBUnevictable:48 kBMlocked:48 kB.....
查看内存硬件信息[email protected]:/home/peng# dmidecode -t memory# dmidecode 3.0Getting SMBIOS data from sysfs.SMBIOS 2.7 present. Handle 0x0084, DMI type 5, 46 bytesMemory Controller InformationError Detecting Method: NoneError Correcting Capabilities:NoneSupported Interleave: One-way InterleaveCurrent Interleave: One-way InterleaveMaximum Memory Module Size: 32768 MBMaximum Total Memory Size: 491520 MBSupported Speeds:70 ns60 nsSupported Memory Types:FPMEDODIMMSDRAMMemory Module Voltage: 3.3 VAssociated Memory Slots: 15.....
内存最大值是 491520 MB 。3. 磁盘查看硬盘和分区分布
[email protected]:/home/peng# lsblkNAMEMAJ:MIN RMSIZE RO TYPE MOUNTPOINTsr011:01 1024M0 romsda8:00500G0 disk ├─sda28:201K0 part ├─sda58:50975M0 part [SWAP]└─sda18:10499G0 part /
查看硬盘和分区的详细信息[email protected]:/home/peng# fdisk -lDisk /dev/sda: 500 GiB, 536870912000 bytes, 1048576000 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: dosDisk identifier: 0x9c674a44DeviceBootStartEndSectorsSize Id Type/dev/sda1*2048 1046575103 1046573056499G 83 Linux/dev/sda21046577150 10485739511996802975M5 Extended/dev/sda51046577152 10485739511996800975M 82 Linux swap / Solaris
4. 网卡查看网卡硬件信息[email protected]:/home/peng# lspci | grep -i 'eth'02:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)
查看系统的所有网络接口[email protected]:/home/peng# ifconfig -aens33Link encap:EthernetHWaddr 00:0c:29:bb:bd:40inet addr:192.168.0.117Bcast:192.168.0.255Mask:255.255.255.0inet6 addr: fe80::76fa:5548:3da0:2ef/64 Scope:LinkUP BROADCAST RUNNING MULTICASTMTU:1500Metric:1RX packets:174629 errors:0 dropped:0 overruns:0 frame:0TX packets:105285 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:237519396 (237.5 MB)TX bytes:9592767 (9.5 MB)loLink encap:Local Loopbackinet addr:127.0.0.1Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNINGMTU:65536Metric:1RX packets:854 errors:0 dropped:0 overruns:0 frame:0TX packets:854 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:60894 (60.8 KB)TX bytes:60894 (60.8 KB)
以上关于本文的内容,仅作参考!温馨提示:如遇健康、疾病相关的问题,请您及时就医或请专业人士给予相关指导!
「四川龙网」www.sichuanlong.com小编还为您精选了以下内容,希望对您有所帮助:
- 考研如何查看档案
- 夫妻之间要不要查看对方手机 夫妻间该不该互看手机
- 移动硬盘灯亮但不读取 移动硬盘闪灯但读不出
- 联想yoga11s换固态硬盘 yoga 11s拆解
- 最安全长久的存储工具 移动硬盘容易坏吗能修好了
- 格式化硬盘操作方法 新买的移动硬盘如何分区
- 手机号码忘了怎么查号码多少 怎么查看本机号码
- 如果查看路由器SSID ssid是什么意思
- 共同好友能查看是谁吗 qq共同好友具体是谁
- 如果查看路由器SSID 网络ssid是什么意思