
過去幾天我正在考慮從 Windows 遷移到 Linux,並且我在這裡閱讀了一些問題,但我想了解更多有關某些事情的信息,尤其是驅動程式方面的信息。他們說 Linux 不需要驅動程序,但我讀過這裡一個問題的答案之一,它說需要安裝一些硬件,如 WiFi 和顯示卡。
我知道如何使用 Linux,大多數時候我使用終端機只是因為線上指南總是告訴我要運行哪些命令。但是,我不確定除此之外還能做什麼。
在Windows中,我可以透過裝置管理員查看所有已安裝的硬體。 Linux 存在這樣的東西嗎?它是一個命令,還是有一個圖形包來執行此操作
答案1
我認為你最好的選擇是lshw
、、、和。這些都是基於終端的,這意味著您必須在終端機(++)中運行它們。lspci
lspcmcia
lsusb
CtrlAltT
這三個命令(及其標誌,請參閱 參考資料man <command>
以獲取更多資訊)可以告訴您很多有關係統的資訊。
然而,大多數這些工具都僅限於只能看到核心可以看到的內容。如果核心看不到它,通常意味著硬體安裝不當、死機或損壞。此外,這些命令無法協助您對設備進行主動故障排除。它們純粹是提供資訊的——它們不會直接幫助您安裝驅動程式等。
lshw
關於您計算機中的硬體的全面報告。它沒有檢測到一切,但這絕對是一個好的步驟。
請參閱man lshw
以獲取更多資訊。
範例輸出:
[redacted]
description: Notebook
product: [redacted]
vendor: ASUSTeK COMPUTER INC.
version: 1.0
serial: [redacted]
width: 64 bits
capabilities: smbios-2.7 dmi-2.7 vsyscall32
configuration: boot=normal chassis=notebook family=Q sku=ASUS-NotebookSKU uuid=1B63B879-2A96-C097-DD6B-10C37B1EECDE
*-core
description: Motherboard
product: [redacted]
vendor: ASUSTeK COMPUTER INC.
physical id: 0
version: 1.0
serial: BSN12345678901234567
slot: MIDDLE
*-firmware
description: BIOS
vendor: American Megatrends Inc.
physical id: 0
version: [redacted]
date: 06/16/2014
size: 64KiB
capacity: 6080KiB
capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer acpi usb smartbattery biosbootspecification uefi
*-cpu
description: CPU
product: Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
vendor: Intel Corp.
physical id: 8
bus info: cpu@0
version: Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
slot: SOCKET 0
size: 1800MHz
capacity: 3800MHz
width: 64 bits
clock: 100MHz
capabilities: x86-64 fpu fpu_exception wp 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 constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cpufreq
configuration: cores=2 enabledcores=2 threads=4
*-cache:0
description: L2 cache
physical id: 9
slot: CPU Internal L2
size: 512KiB
capacity: 512KiB
capabilities: internal write-back unified
*-cache:1
description: L1 cache
physical id: a
slot: CPU Internal L1
size: 128KiB
capacity: 128KiB
capabilities: internal write-back
*-cache:2
description: L3 cache
physical id: b
slot: CPU Internal L3
size: 4MiB
capacity: 4MiB
capabilities: internal write-back unified
*-memory
description: System Memory
physical id: c
slot: System board or motherboard
size: 8GiB
*-bank:0
description: SODIMM DDR3 Synchronous 1600 MHz (0.6 ns)
product: M471B5173QH0-YK0
vendor: Samsung
physical id: 0
serial: 15A0DE9D
slot: ChannelA-DIMM0
size: 4GiB
width: 64 bits
clock: 1600MHz (0.6ns)
*-bank:1
description: DIMM [empty]
product: [Empty]
vendor: [Empty]
physical id: 1
serial: [Empty]
slot: ChannelA-DIMM1
*-bank:2
description: SODIMM DDR3 Synchronous 1600 MHz (0.6 ns)
product: M471B5173QH0-YK0
vendor: Samsung
physical id: 2
serial: 15A0DE9C
slot: ChannelB-DIMM0
size: 4GiB
width: 64 bits
clock: 1600MHz (0.6ns)
*-bank:3
description: DIMM [empty]
product: [Empty]
vendor: [Empty]
physical id: 3
serial: [Empty]
slot: ChannelB-DIMM1
*-pci
description: Host bridge
product: Haswell-ULT DRAM Controller
vendor: Intel Corporation
physical id: 100
bus info: pci@0000:00:00.0
version: 09
width: 32 bits
clock: 33MHz
*-display
description: VGA compatible controller
product: Haswell-ULT Integrated Graphics Controller
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 09
width: 64 bits
clock: 33MHz
capabilities: msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:59 memory:f7400000-f77fffff memory:d0000000-dfffffff ioport:f000(size=64)
*-multimedia:0
description: Audio device
product: Haswell-ULT HD Audio Controller
vendor: Intel Corporation
physical id: 3
bus info: pci@0000:00:03.0
version: 09
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list
configuration: driver=snd_hda_intel latency=0
resources: irq:63 memory:f7a1c000-f7a1ffff
*-generic:0 UNCLAIMED
description: Signal processing controller
product: Intel Corporation
vendor: Intel Corporation
physical id: 4
bus info: pci@0000:00:04.0
version: 09
width: 64 bits
clock: 33MHz
capabilities: msi pm bus_master cap_list
configuration: latency=0
resources: memory:f7a10000-f7a17fff
*-usb
description: USB controller
product: Lynx Point-LP USB xHCI HC
vendor: Intel Corporation
physical id: 14
bus info: pci@0000:00:14.0
version: 04
width: 64 bits
clock: 33MHz
capabilities: pm msi xhci bus_master cap_list
configuration: driver=xhci_hcd latency=0
resources: irq:56 memory:f7a00000-f7a0ffff
*-communication
description: Communication controller
product: Lynx Point-LP HECI #0
vendor: Intel Corporation
physical id: 16
bus info: pci@0000:00:16.0
version: 04
width: 64 bits
clock: 33MHz
capabilities: pm msi bus_master cap_list
configuration: driver=mei_me latency=0
resources: irq:60 memory:f7a24000-f7a2401f
*-multimedia:1
description: Audio device
product: Lynx Point-LP HD Audio Controller
vendor: Intel Corporation
physical id: 1b
bus info: pci@0000:00:1b.0
version: 04
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list
configuration: driver=snd_hda_intel latency=0
resources: irq:62 memory:f7a18000-f7a1bfff
*-pci:0
description: PCI bridge
product: Lynx Point-LP PCI Express Root Port 1
vendor: Intel Corporation
physical id: 1c
bus info: pci@0000:00:1c.0
version: e4
width: 32 bits
clock: 33MHz
capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:16
*-pci:1
description: PCI bridge
product: Lynx Point-LP PCI Express Root Port 3
vendor: Intel Corporation
physical id: 1c.2
bus info: pci@0000:00:1c.2
version: e4
width: 32 bits
clock: 33MHz
capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:18 ioport:e000(size=4096) memory:f7900000-f79fffff ioport:f2100000(size=1048576)
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:02:00.0
logical name: eth0
version: 0c
serial: 10:c3:7b:1e:ec:de
size: 10Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168g-2_0.0.1 02/06/13 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
resources: irq:58 ioport:e000(size=256) memory:f7900000-f7900fff memory:f2100000-f2103fff
*-pci:2
description: PCI bridge
product: Lynx Point-LP PCI Express Root Port 4
vendor: Intel Corporation
physical id: 1c.3
bus info: pci@0000:00:1c.3
version: e4
width: 32 bits
clock: 33MHz
capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:19 memory:f7800000-f78fffff
*-network
description: Wireless interface
product: Wireless 7260
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:03:00.0
logical name: wlan0
version: 6b
serial: 80:86:f2:23:78:69
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=3.16.0-43-generic firmware=25.228.9.0 ip=10.0.2.102 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn
resources: irq:61 memory:f7800000-f7801fff
*-pci:3
description: PCI bridge
product: Lynx Point-LP PCI Express Root Port 5
vendor: Intel Corporation
physical id: 1c.4
bus info: pci@0000:00:1c.4
version: e4
width: 32 bits
clock: 33MHz
capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:16 ioport:d000(size=4096) memory:f6000000-f70fffff ioport:e0000000(size=301989888)
*-generic UNCLAIMED
description: Unassigned class
product: Illegal Vendor ID
vendor: Illegal Vendor ID
physical id: 0
bus info: pci@0000:04:00.0
version: ff
width: 32 bits
clock: 66MHz
capabilities: bus_master vga_palette cap_list
configuration: latency=255 maxlatency=255 mingnt=255
resources: memory:f6000000-f6ffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:d000(size=128) memory:f7000000-f707ffff
*-isa
description: ISA bridge
product: Lynx Point-LP LPC Controller
vendor: Intel Corporation
physical id: 1f
bus info: pci@0000:00:1f.0
version: 04
width: 32 bits
clock: 33MHz
capabilities: isa bus_master cap_list
configuration: driver=lpc_ich latency=0
resources: irq:0
*-storage
description: SATA controller
product: Lynx Point-LP SATA Controller 1 [AHCI mode]
vendor: Intel Corporation
physical id: 1f.2
bus info: pci@0000:00:1f.2
version: 04
width: 32 bits
clock: 66MHz
capabilities: storage msi pm ahci_1.0 bus_master cap_list
configuration: driver=ahci latency=0
resources: irq:57 ioport:f0b0(size=8) ioport:f0a0(size=4) ioport:f090(size=8) ioport:f080(size=4) ioport:f060(size=32) memory:f7a22000-f7a227ff
*-serial UNCLAIMED
description: SMBus
product: Lynx Point-LP SMBus Controller
vendor: Intel Corporation
physical id: 1f.3
bus info: pci@0000:00:1f.3
version: 04
width: 64 bits
clock: 33MHz
configuration: latency=0
resources: memory:f7a21000-f7a210ff ioport:f040(size=32)
*-generic:1 UNCLAIMED
description: Signal processing controller
product: Lynx Point-LP Thermal
vendor: Intel Corporation
physical id: 1f.6
bus info: pci@0000:00:1f.6
version: 04
width: 64 bits
clock: 33MHz
capabilities: pm msi bus_master cap_list
configuration: latency=0
resources: memory:f7a20000-f7a20fff
*-scsi:0
physical id: 1
logical name: scsi0
capabilities: emulated
*-disk
description: ATA Disk
product: ST1000LM024 HN-M
vendor: Seagate
physical id: 0.0.0
bus info: scsi@0:0.0.0
logical name: /dev/sda
version: 0002
serial: S2Y4J9DF302858
size: 931GiB (1TB)
capabilities: gpt-1.00 partitioned partitioned:gpt
configuration: ansiversion=5 guid=3ed421d9-4412-4dfe-ab2e-ec026958789b sectorsize=4096
*-volume:0 UNCLAIMED
description: Windows FAT volume
vendor: mkfs.fat
physical id: 1
bus info: scsi@0:0.0.0,1
version: FAT32
serial: 79ce-21ea
size: 1126MiB
capacity: 1127MiB
capabilities: boot fat initialized
configuration: FATs=2 filesystem=fat label=EFI
*-volume:1
description: Windows NTFS volume
vendor: Windows
physical id: 2
bus info: scsi@0:0.0.0,2
logical name: /dev/sda2
version: 3.1
serial: 72182df1-59f4-4645-ab5d-c51c8574253d
size: 509GiB
capacity: 509GiB
capabilities: ntfs initialized
configuration: clustersize=4096 created=2014-12-18 19:09:28 filesystem=ntfs label=Windows modified_by_chkdsk=true mounted_on_nt4=true name=Basic data partition resize_log_file=true state=dirty upgrade_on_mount=true
*-volume:2
description: Windows NTFS volume
vendor: Windows
physical id: 3
bus info: scsi@0:0.0.0,3
logical name: /dev/sda3
version: 3.1
serial: 2653-69df
size: 420MiB
capacity: 449MiB
capabilities: boot precious readonly hidden nomount ntfs initialized
configuration: clustersize=4096 created=2015-06-01 22:45:26 filesystem=ntfs state=clean
*-volume:3
description: Apple Core Storage (File Vault)
vendor: Mac OS X (journaled)
physical id: 4
bus info: scsi@0:0.0.0,4
logical name: /dev/sda4
version: 5
serial: 70a6d4ed-70bc-c40c-0000-000000640000
size: 199GiB
capacity: 199GiB
capabilities: encrypted hfsx journaled bootable osx hfsplus initialized
configuration: boot=osx checked=2015-01-01 21:58:27 created=2015-01-01 21:58:27 filesystem=hfsplus lastmountedby=HFSJ modified=2015-05-15 11:03:06 name=Mac OS X state=unclean
*-volume:4
description: boot partition
vendor: Mac OS X (journaled)
physical id: 5
bus info: scsi@0:0.0.0,5
logical name: /dev/sda5
version: 4
serial: 3081fb24-64d6-7690-0000-000000005000
size: 619MiB
capacity: 619MiB
capabilities: boot journaled bootable macos osx hfsplus initialized
configuration: checked=2015-01-01 14:03:07 created=2015-01-01 14:03:07 filesystem=hfsplus lastmountedby=HFSJ modified=2015-05-15 11:03:01 name=Recovery HD state=unclean
*-volume:5
description: Windows NTFS volume
vendor: Windows
physical id: 6
bus info: scsi@0:0.0.0,6
logical name: /dev/sda6
version: 3.1
serial: 4630-ec9c
size: 894MiB
capacity: 899MiB
capabilities: boot precious readonly hidden nomount ntfs initialized
configuration: clustersize=4096 created=2014-12-18 19:09:24 filesystem=ntfs label=Recovery state=clean
*-volume:6
description: reserved partition
vendor: Windows
physical id: 7
bus info: scsi@0:0.0.0,7
logical name: /dev/sda7
serial: d8318946-2259-48b7-b7c8-91326f7b4537
capacity: 127MiB
capabilities: nofs
*-volume:7
description: EXT4 volume
vendor: Linux
physical id: 8
bus info: scsi@0:0.0.0,8
logical name: /dev/sda8
logical name: /
version: 1.0
serial: 2f30acd8-6985-413e-97d0-1317ff84734d
size: 211GiB
capabilities: journaled extended_attributes large_files huge_files dir_nlink recover extents ext4 ext2 initialized
configuration: created=2015-07-16 11:39:47 filesystem=ext4 lastmountpoint=/ modified=2015-07-18 15:32:54 mount.fstype=ext4 mount.options=rw,relatime,errors=remount-ro,data=ordered mounted=2015-07-18 15:32:54 state=mounted
*-volume:8
description: Linux swap volume
vendor: Linux
physical id: 9
bus info: scsi@0:0.0.0,9
logical name: /dev/sda9
version: 1
serial: c3ccac50-afff-49ce-97ce-23c42e1716b2
size: 8191MiB
capacity: 8191MiB
capabilities: nofs swap initialized
configuration: filesystem=swap pagesize=4096
*-scsi:1
physical id: 2
logical name: scsi1
capabilities: emulated
*-cdrom
description: DVD-RAM writer
product: DVD-RAM UJ8E2 S
vendor: MATSHITA
physical id: 0.0.0
bus info: scsi@1:0.0.0
logical name: /dev/cdrom
logical name: /dev/sr0
version: 1.00
capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
configuration: ansiversion=5 status=nodisc
注意sudo lshw
為了獲得最佳效果, 應以超級使用者 ( ) 身分執行此命令。
lspci
該命令將其搜尋限制為 PCI 總線以及與其連接的所有內容。它有助於獲取有關計算機中物理設備的更詳細資訊。此外,lspci -k
還將顯示所有裝置及其相應的核心驅動程式——有助於查看哪些裝置已啟用,哪些未啟用。
請參閱man lspci
以獲取更多資訊。
範例輸出:
00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 09)
00:04.0 Signal processing controller: Intel Corporation Device 0a03 (rev 09)
00:14.0 USB controller: Intel Corporation Lynx Point-LP USB xHCI HC (rev 04)
00:16.0 Communication controller: Intel Corporation Lynx Point-LP HECI #0 (rev 04)
00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 1 (rev e4)
00:1c.2 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 3 (rev e4)
00:1c.3 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 4 (rev e4)
00:1c.4 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 5 (rev e4)
00:1f.0 ISA bridge: Intel Corporation Lynx Point-LP LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation Lynx Point-LP SATA Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation Lynx Point-LP SMBus Controller (rev 04)
00:1f.6 Signal processing controller: Intel Corporation Lynx Point-LP Thermal (rev 04)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
03:00.0 Network controller: Intel Corporation Wireless 7260 (rev 6b)
04:00.0 3D controller: NVIDIA Corporation GK107M [GeForce GT 745M] (rev ff)
lspcmcia
此命令將列出您電腦上安裝的所有 PCMCIA 設備。但是,大多數現代電腦不再具有 PCMCIA 端口,因此此命令可能會傳回 null。
請參閱man lspcmcia
以獲取更多資訊。
lsusb
該命令本質上是lspci
針對 USB 的。它顯示 USB 總線以及連接到它們的所有內容。它最適合用於查找計算機中的周邊設備。
請參閱man lsusb
以獲取更多資訊。
範例輸出:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller
Bus 001 Device 011: ID 04f3:010c Elan Microelectronics Corp.
Bus 001 Device 003: ID 13d3:5188 IMC Networks
Bus 001 Device 002: ID 8087:07dc Intel Corp.
Bus 001 Device 012: ID 1532:003e Razer USA, Ltd
Bus 001 Device 014: ID 18d1:4ee2 Google Inc. Nexus 4 (debug)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
獎金:lscpu
上述工具並不總是最適合尋找處理器資訊。該命令是專門為此目的而設計的,並將為您提供非常詳細的資訊。
請參閱man 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: 69
Stepping: 1
CPU MHz: 2124.281
BogoMIPS: 4789.14
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 4096K
NUMA node0 CPU(s): 0-3
獎金:lsdev
該命令是系統上所有設備的非常高級的清單。預設沒有安裝,您需要proctools
像這樣安裝:
sudo apt-get install proctools
它最適合尋找裝置正在使用的 I/O 位址、DMA 和 IRQ。
請參閱man lsdev
了解更多信息
範例輸出:
Device DMA IRQ I/O Ports
------------------------------------------------
0000:00:02.0 f000-f03f
0000:00:1f.2 f060-f07f f080-f083 f090-f097 f0a0-f0a3 f0b0-f0b7
0000:00:1f.3 f040-f05f
0000:02:00.0 e000-e0ff
0000:04:00.0 d000-d07f
ACPI 1800-1803 1804-1805 1808-180b 1810-1815 1850-1850 1880-189f
acpi 9
ahci 57 f060-f07f f080-f083 f090-f097 f0a0-f0a3 f0b0-f0b7
cascade 4
dma 0080-008f
dma1 0000-001f
dma2 00c0-00df
EC 0062-0062 0066-0066
eth0 58
fpu 00f0-00ff
i8042 1 12
i915 59
iTCO_wdt 1830-1833 1860-187f
iwlwifi 61
keyboard 0060-0060 0064-0064
mei_me 60
PCI 0000-0cf7 0cf8-0cff 0d00-ffff d000-dfff e000-efff
pic1 0020-0021
pic2 00a0-00a1
pnp 0240-0259 04d0-04d1 0680-069f 164e-164f 1854-1857 1c00-1cfe 1d00-1dfe 1e00-1efe 1f00-1ffe ffff-ffff ffff-ffff ffff-ffff
PNP0C09:00 0062-0062 0066-0066
r8169 e000-e0ff
rtc0 8 0070-0077
snd_hda_intel 62 63
timer 0
timer0 0040-0043
timer1 0050-0053
xhci_hcd 56