close

Linux 查看系統硬件信息(實例詳解)
linux查看系統的硬件信息,並不像windows那麽直觀,這裏我羅列了查看系統信息的實用命令,並做了分類,實例解說。

lscpu命令,查看的是cpu的統計信息.

blue@blue-pc:~$ lscpu
Architecture: i686 #cpu架構
CPU op-mode(s): -bit, -bit
Byte Order: Little Endian #小尾序
CPU(s): #總共有4核
On-line CPU(s) list: -
Thread(s) per core: #每個cpu核,只能支持一個線程,即不支持超線程
Core(s) per socket: #每個cpu,有4個核
Socket(s): #總共有1一個cpu
Vendor ID: GenuineIntel #cpu產商 intel
CPU family:
Model:
Stepping:
CPU MHz: 1600.000
BogoMIPS: 5986.12
Virtualization: VT-x #支持cpu虛擬化技術
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 6144K
查看/proc/cpuinfo,可以知道每個cpu信息,如每個CPU的型號,主頻等。

cat /proc/cpuinfo

processor :
vendor_id : GenuineIntel
cpu family :
model :
model name : Intel(R) Core(TM) i5- CPU @ .00GHz
…..
上面輸出的是第一個cpu部分信息,還有3個cpu信息省略了。

概要查看內存情況

-m
total used shared buffers cached
Mem:
-/+ buffers/cache:
Swap:
這裏的單位是MB,總共的內存是3926MB。

查看內存詳細使用

/proc/meminfo

MemTotal: 4020868 kB
MemFree: 230884 kB
Buffers: kB
Cached: 454772 kB
SwapCached: kB
…..
查看內存硬件信息

dmidecode -t memory

dmidecode

SMBIOS present.

Handle 0x0008, DMI type , bytes
Physical Memory Array
Location: System Board Or Motherboard
….
Maximum Capacity: GB
….

Handle 0x000A, DMI type , bytes
….
Memory Device
Array Handle: 0x0008
Error Information Handle: Not Provided
Total Width: bits
Data Width: bits
Size: MB
…..
我的主板有4個槽位,只用了一個槽位,上面插了一條4096MB的內存。

查看硬盤和分區分布

lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda : .8G disk
├─sda1 : 1G part /boot
├─sda2 : .3G part [SWAP]
├─sda3 : .5G part /
├─sda4 : 1K part
├─sda5 : .8G part /home
└─sda6 : .2G part
顯示很直觀

如果要看硬盤和分區的詳細信息

fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
heads, sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00023728

Device Boot Start End Blocks Id System
/dev/sda1 * 2148351 1073152 Linux
/dev/sda2 2148352 21680127 9765888 Linux swap / Solaris
/dev/sda3 21680128 177930239 78125056 Linux
/dev/sda4 177932286 976771071 399419393 Extended/dev/sda5 177932288 412305407 117186560 Linux
/dev/sda6 412307456 976771071 282231808 Linux
查看網卡硬件信息

lspci | -i
Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev )
查看系統的所有網絡接口

ifconfig -a

eth0 Link encap:以太網 硬件地址 b8::5a::b3:8f
…..

lo Link encap:本地環回 ….. ip link show lo: mtu 16436 qdisc noqueue state DOWN
link/loopback ::::: brd ::::: eth0:
ethtool eth0

Settings eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full #支持千兆半雙工,全雙工模式
Supported pause frame use: No
Supports auto-negotiation: Yes #支持自適應模式,一般都支持
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes #默認使用自適應模式
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/ …..
Speed: 100Mb/s #現在網卡的速度是100Mb,網卡使用自適應模式,所以推測路由是100Mb,導致網卡從支持千兆,變成要支持百兆
Duplex: Full #全雙工
…..
Link detected: yes #表示有網線連接,和路由是通的
查看pci信息,即主板所有硬件槽信息。

lspci Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev ) #主板芯片 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev : USB controller: Intel Corporation Panther Point USB xHCI Host Controller (rev ) #usb控制器 Communication controller: Intel Corporation Panther Point MEI Controller # (rev :1a. USB controller: Intel Corporation Panther Point USB Enhanced Host Controller # (rev :1b. Audio device: Intel Corporation Panther Point High Definition Audio Controller (rev :1c. PCI bridge: Intel Corporation Panther Point PCI Express Root Port (rev c4) #pci 插槽
:1c. PCI bridge: Intel Corporation Panther Point PCI Express Root Port (rev c4)
:1c. PCI bridge: Intel Corporation Panther Point PCI Express Root Port (rev c4)
:1d. USB controller: Intel Corporation Panther Point USB Enhanced Host Controller # (rev :1f. ISA bridge: Intel Corporation Panther Point LPC Controller (rev :1f. IDE interface: Intel Corporation Panther Point port SATA Controller [IDE mode] (rev ) #硬盤接口
:1f. SMBus: Intel Corporation Panther Point SMBus Controller (rev :1f. IDE interface: Intel Corporation Panther Point port SATA Controller [IDE mode] (rev ) #硬盤接口 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev : PCI bridge: Integrated Technology Express, Inc. Device (rev )
如果要更詳細的信息:lspci -v 或者 lspci -vv
如果要看設備樹:lspci -t

查看bios信息

dmidecode -t bios

……
BIOS Information
Vendor: American Megatrends Inc.
Version: .
Release Date: //
…….
BIOS Revision:
……
dmidecode以一種可讀的方式dump出機器的DMI(Desktop Management Interface)信息。這些信息包括了硬件以及BIOS,既可以得到當前的配置,也可以得到系統支持的最大配置,比如說支持的最大內存數等

如果要查看所有有用信息

dmidecode -q
裏面包含了很多硬件信息。
MeasureMeasure
Get a free Evernote account to save this article and view it later on any device.
Create account

arrow
arrow
    全站熱搜

    主要步驟 發表在 痞客邦 留言(0) 人氣()