Linux 系统查看硬件信息

cpu

lscpu命令,查看的是cpu的统计信息.

#lscpu

架构:           x86_64            #cpu架构

CPU 运行模式:   32-bit, 64-bit

字节序:         Little Endian

CPU:             2                   #总共有2核

在线 CPU 列表:  0,1            #正在运行中的cpu

每个核的线程数: 1              #每个cpu核支持一个线程,不支持超线程      

每个座的核数:   2                #每个cpu2核

座:             1                        #共有1个cpu

NUMA 节点:      1             

厂商 ID:        GenuineIntel

CPU 系列:       6

型号:           94

型号名称:       Intel(R) Pentium(R) CPU G4400 @ 3.30GHz   #cpu型号

步进:           3

CPU MHz:        800.114

CPU 最大 MHz:   3300.0000

CPU 最小 MHz:   800.0000

BogoMIPS:       6599.98

虚拟化:         VT-x

L1d 缓存:       32K

L1i 缓存:       32K

L2 缓存:        256K

L3 缓存:        3072K

NUMA 节点0 CPU: 0,1

 

查看/proc/cpuinfo,查看每个cpu的具体信息,我这里有两个cpu

# cat /proc/cpuinfo

processor : 0            

vendor_id : GenuineIntel

cpu family   : 6

model     : 94

model name   : Intel(R) Pentium(R) CPU G4400 @ 3.30GHz              #cpu0

stepping  : 3

microcode : 0xd6

cpu MHz      : 800.113

cache size   : 3072 KB

physical id  : 0

siblings  : 2

core id      : 0

cpu cores : 2

apicid    : 0

initial apicid   : 0

fpu   : yes

fpu_exception : yes

cpuid level  : 22

wp    : yes

 

bugs      : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit

bogomips  : 6599.98

clflush size : 64

cache_alignment  : 64

address sizes : 39 bits physical, 48 bits virtual

power management:

 

processor : 1

vendor_id : GenuineIntel

cpu family   : 6

model     : 94

model name   : Intel(R) Pentium(R) CPU G4400 @ 3.30GHz              #cpu1

stepping  : 3

microcode : 0xd6

cpu MHz      : 800.084

cache size   : 3072 KB

physical id  : 0

siblings  : 2

core id      : 1

cpu cores : 2

apicid    : 2

initial apicid   : 2

fpu   : yes

fpu_exception : yes

cpuid level  : 22

wp    : yes

 

内存

# free -h

              总计         已用        空闲      共享    缓冲/缓存    可用

内存:        3.7G        1.0G        249M        166M        2.5G        2.3G

交换:        2.0G        648M        1.4G

查看内存详细

#cat /proc/meminfo

MemTotal:        3915832 kB

MemFree:          255484 kB

MemAvailable:    2431976 kB

Buffers:          573484 kB

Cached:          1711372 kB

SwapCached:        60888 kB

Active:          1714128 kB

Inactive:        1376180 kB

Active(anon):     473392 kB

Inactive(anon):   502468 kB

Active(file):    1240736 kB

Inactive(file):   873712 kB

Unevictable:        1992 kB

Mlocked:              16 kB

SwapTotal:       2097148 kB

SwapFree:        1433596 kB

 

磁盘

查看硬盘和分区

# lsblk

NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT

sda               8:0    0   20G  0 disk

├─sda1            8:1    0    1G  0 part /boot

└─sda2            8:2    0   19G  0 part

  ├─centos-root 253:0    0   17G  0 lvm  /

  └─centos-swap 253:1    0    2G  0 lvm  [SWAP]

sr0              11:0    1 1024M  0 rom 

查看硬盘的uuid号和分区文件系统

# blkid

/dev/sda1: UUID="f2397487-b271-4abd-8b1e-f5b465b60978" TYPE="xfs"

/dev/sda2:UUID="H1Cqcs-5sZg-Zv05-3M80-MO9J-mcHY-BVMI6S"TYPE="LVM2_member"

/dev/mapper/centos-root: UUID="cdfe8928-66d5-4d86-b2c8-037fb6db01ef" TYPE="xfs"

/dev/mapper/centos-swap:UUID="347b96f7-8778-4a41-9f7b-244a51f78080" TYPE="swap"

 

查看硬盘分区的详细信息

# fdisk -l

磁盘 /dev/sda:21.5 GB, 21474836480 字节,41943040 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

磁盘标签类型:dos

磁盘标识符:0x00073990

 

   设备 Boot      Start         End      Blocks   Id  System

/dev/sda1   *        2048     2099199     1048576   83  Linux

/dev/sda2         2099200    41943039    19921920   8e  Linux LVM

 

磁盘 /dev/mapper/centos-root:18.2 GB, 18249416704 字节,35643392 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

 

磁盘 /dev/mapper/centos-swap:2147 MB, 2147483648 字节,4194304 个扇区

Units = 扇区 of 1 * 512 = 512 bytes

扇区大小(逻辑/物理):512 字节 / 512 字节

I/O 大小(最小/最佳):512 字节 / 512 字节

网卡

查看所有网卡信息

# ifconfig -a

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  #设备ip地址

        inet 192.168.xxx.xxx netmask 255.255.255.0  broadcast 192.168.xxx.255

        inet6 fe80::2313:55c0:58ec:767d  prefixlen 64  scopeid 0x20<link>

        ether 00:0c:29:d6:8c:aa  txqueuelen 1000  (Ethernet)

        RX packets 1989  bytes 2285536 (2.1 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 791  bytes 67054 (65.4 KiB)

        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 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

或者

# ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

       valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host

       valid_lft forever preferred_lft forever

2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 00:0c:29:d6:8c:aa brd ff:ff:ff:ff:ff:ff

    inet 192.168.190.139/24 brd 192.168.190.255 scope global noprefixroute dynamic ens33

       valid_lft 1211sec preferred_lft 1211sec

    inet6 fe80::2313:55c0:58ec:767d/64 scope link noprefixroute

       valid_lft forever preferred_lft forever

 

查看某个网卡的详细信息

# ethtool ens33

Settings for ens33:

   Supported ports: [ TP ]

   Supported link modes:   10baseT/Half 10baseT/Full

                           100baseT/Half 100baseT/Full

                           1000baseT/Full

   Supported pause frame use: No

   Supports auto-negotiation: Yes   #支持自适应模式

   Supported FEC modes: Not reported

   Advertised link modes:  10baseT/Half 10baseT/Full

                           100baseT/Half 100baseT/Full

                           1000baseT/Full

   Advertised pause frame use: No

   Advertised auto-negotiation: Yes  #默认使用自适应模式

   Advertised FEC modes: Not reported

   Speed: 1000Mb/s    #网卡的速度

   Duplex: Full         #全双工

   Port: Twisted Pair

   PHYAD: 0

   Transceiver: internal

   Auto-negotiation: on

   MDI-X: off (auto)

   Supports Wake-on: d

   Wake-on: d

   Current message level: 0x00000007 (7)

                 drv probe link

   Link detected: yes     #有网线连接

 

查看网卡速率

# mii-tool ens33

ens33: negotiated 1000baseT-FD flow-control, link ok

 

查看网卡驱动

# ethtool -i ens33

driver: e1000   #驱动

version: 7.3.21-k8-NAPI

firmware-version:

expansion-rom-version:

bus-info: 0000:02:01.0

supports-statistics: yes

supports-test: yes

supports-eeprom-access: yes

supports-register-dump: yes

supports-priv-flags: no

 

 

主板槽位信息

# lspci    #查看pci信息,主板所有硬件槽信息

00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)

00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)

00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)

00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)

00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)

00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)

00:0f.0 VGA compatible controller: VMware SVGA II Adapter

00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)

00:11.0 PCI bridge: VMware PCI bridge (rev 02)

00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)

00:15.1 PCI bridge: VMware PCI Express Root Port (rev 01)

00:15.2 PCI bridge: VMware PCI Express Root Port (rev 01)

02:00.0 USB controller: VMware USB1.1 UHCI Controller

02:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)

02:02.0 Multimedia audio controller: Ensoniq ES1371/ES1373 / Creative Labs CT2518 (rev 02)

02:03.0 USB controller: VMware USB2 EHCI Controller

更详细的信息使用:lspci -v 或者 lspci -vv  lspci -vv

# lspci -v

00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)

   Subsystem: VMware Virtual Machine Chipset

   Flags: bus master, medium devsel, latency 0

   Kernel driver in use: agpgart-intel

 

00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01) (prog-if 00 [Normal decode])

   Flags: bus master, 66MHz, medium devsel, latency 0

   Bus: primary=00, secondary=01, subordinate=01, sec-latency=64

 

00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)

   Subsystem: VMware Virtual Machine Chipset

   Flags: bus master, medium devsel, latency 0

 

00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01) (prog-if 8a [ISA Compatibility mode controller, supports both channels switched to PCI native mode, supports bus mastering])

   Subsystem: VMware Virtual Machine Chipset

   Flags: bus master, medium devsel, latency 64

   [virtual] Memory at 000001f0 (32-bit, non-prefetchable) [size=8]

   [virtual] Memory at 000003f0 (type 3, non-prefetchable)

   [virtual] Memory at 00000170 (32-bit, non-prefetchable) [size=8]

   [virtual] Memory at 00000370 (type 3, non-prefetchable)

   I/O ports at 1060 [size=16]

   Kernel driver in use: ata_piix

   Kernel modules: ata_piix, pata_acpi, ata_generic

 

 

bios信息

 

 

# dmidecode -t bios

 dmidecode 3.1

Getting SMBIOS data from sysfs.

SMBIOS 2.7 present.

 

Handle 0x0000, DMI type 0, 24 bytes

BIOS Information

   Vendor: Phoenix Technologies LTD

   Version: 6.00

   Release Date: 07/29/2019

   Address: 0xEA480

   Runtime Size: 88960 bytes

   ROM Size: 64 kB

   Characteristics:

   BIOS Revision: 4.6

   Firmware Revision: 0.0

查看的更详细一点的话使用:# dmidecode -q

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值