编程开源技术交流,分享技术与知识

网站首页 > 开源技术 正文

如何在linux查看硬件信息(linux查看硬件信息命令)

wxchong 2024-10-22 17:57:39 开源技术 10 ℃ 0 评论



lscpu

lscpu命令能够查看 CPU 和处理单元的信息,该命令没有任何其他选项或者别的功能。

lscpu
blue@blue-pc:~$ lscpu
Architecture:          i686            #cpu架构
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian   #小尾序
CPU(s):                4               #总共有4核
On-line CPU(s) list:   0-3
Thread(s) per core:    1               #每个cpu核,只能支持一个线程,即不支持超线程
Core(s) per socket:    4               #每个cpu,有4个核
Socket(s):             1               #总共有1一个cpu
Vendor ID:             GenuineIntel    #cpu产商 intel
CPU family:            6
Model:                 42
Stepping:              7
CPU MHz:               1600.000
BogoMIPS:              5986.12
Virtualization:        VT-x            #支持cpu虚拟化技术
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              6144K

lspci

lspci可以用来列出所有的 PCI 总线,还有与 PCI 总线相连的设备的详细信息,比如 VGA 适配器、显卡、网络适配器、usb 端口、SATA 控制器等。

lspci
lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09) #主板芯片
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) #显卡
00:14.0 USB controller: Intel Corporation Panther Point USB xHCI Host Controller (rev 04) #usb控制器
00:16.0 Communication controller: Intel Corporation Panther Point MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation Panther Point USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation Panther Point High Definition Audio Controller (rev 04) #声卡
00:1c.0 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 1 (rev c4) #pci 插槽
00:1c.2 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 3 (rev c4)
00:1c.3 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 4 (rev c4)
00:1d.0 USB controller: Intel Corporation Panther Point USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation Panther Point LPC Controller (rev 04)
00:1f.2 IDE interface: Intel Corporation Panther Point 4 port SATA Controller [IDE mode] (rev 04) #硬盘接口
00:1f.3 SMBus: Intel Corporation Panther Point SMBus Controller (rev 04)
00:1f.5 IDE interface: Intel Corporation Panther Point 2 port SATA Controller [IDE mode] (rev 04) #硬盘接口
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06) #网卡
03:00.0 PCI bridge: Integrated Technology Express, Inc. Device 8893 (rev 41)

可以通过运行下面的命令来过滤出特定设备的信息,例如关于显卡信息:

lspci -v | grep "VGA" -A 12

lshw

lshw是一个通用的工具,可以列出多种硬件单元的详细或者概要的信息,比如 CPU、内存、usb 控制器、硬盘等。lshw能够从各个“/proc”文件中提取出相关的信息。

lshw -short

lsscsi

通过运行下面的命令可以列出像硬盘和光驱等 scsi/sata 设备的信息:

lsscsi

lsusb

lsusb命令能够列出 USB 控制器和与 USB 控制器相连的设备的详细信息。默认情况下,lsusb命令只打印出概要信息,可以通过使用-v参数打印每一个usb端口的详细信息。

lsusb

inxi

inxi是一个 bash 脚本,能够从系统的多个来源和命令获取硬件信息,并打印出一个非技术人员也能看懂的友好的报告。

默认情况下,Ubuntu 上没有安装inxi。可以通过运行下面命令来安装Inxi:

sudo apt-get install inxi

安装完Inxi之后,通过运行下面命令能够得到硬件相关的信息:

inxi -Fx

df

df命令能够列出不同分区的概要信息、挂载点、已用的和可用的空间,可以在使用df命令的时候加上-H参数(易读格式)。

df -H

free

通过使用free命令可以查看系统中使用的、闲置的和 RAM 的总体数量。

free -m

dmidecode

dmidecode命令与其他命令不同。该命令是从硬件中的 DMI 表中读取信息的。

要查看处理器的信息,运行下面命令:

sudo dmidecode -t processor

要查看内存的信息,运行下面命令:

sudo dmidecode -t memory

要查看 bios 的信息,运行下面命令:

sudo dmidecode -t bios

hdparm

hdparm命令可以用来显示像硬盘这样的 sata 设备的信息。

sudo hdparm


Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表