ハードウェアの情報を収集して出力する
lsusb や lspci などのコマンドがあるけど、まとめて実行して情報を取り出すには不便。調べたら lshw といういうコマンドを見つけた
インストール
takuya@:~$ sudo apt search lshw ソート中... 完了 全文検索... 完了 lshw/stable 02.18-0.1 amd64 ハードウェア設定に関する情報 lshw-gtk/stable 02.18-0.1 amd64 ハードウェア構成に関する情報をグラフィカルに表示 python3-checkbox-support/stable 0.22-1 all collection of Python modules used by PlainBox providers takuya@:~$ sudo apt instal lshw
使い方
sudo をつけてコマンドを実行すると良い。 htmlやXMLで取得することも可能だ。
takuya@:~$ sudo lshw -h
Hardware Lister (lshw) - unknown
usage: lshw [-format] [-options ...]
lshw -version
-version print program version (unknown)
format can be
-html output hardware tree as HTML
-xml output hardware tree as XML
-short output hardware paths
-businfo output bus information
options can be
-class CLASS only show a certain class of hardware
-C CLASS same as '-class CLASS'
-c CLASS same as '-class CLASS'
-disable TEST disable a test (like pci, isapnp, cpuid, etc. )
-enable TEST enable a test (like pci, isapnp, cpuid, etc. )
-quiet don't display status
-sanitize sanitize output (remove sensitive information like serial numbers, etc.)
-numeric output numeric IDs (for PCI, USB, etc.)
-notime exclude volatile attributes (timestamps) from output
実行例
そのまま実行すると出力が大きすぎなので、ターミナルで実行するときは -short オプションがおすすめ
takuya@:~$ sudo lshw -short
H/W path デバイス クラス 詳細
=======================================================
system To Be Filled By O.E.M. (To Be Filled By O.E.M.)
/0 bus J5005-ITX
/0/0 memory 64KiB BIOS
/0/b memory 8GiB システムメモリー
/0/b/0 memory 8GiB SODIMM DDR4 同期 2400 MHz (0.4 ns)
/0/b/1 memory DIMM DDR2 同期 [空]
/0/15 memory 224KiB L1 キャッシュ
/0/16 memory 4MiB L2 キャッシュ
/0/17 processor Intel(R) Pentium(R) Silver J5005 CPU @ 1.50GHz
/0/100 bridge Intel Corporation
/0/100/0.1 generic Intel Corporation
/0/100/2 display Intel Corporation
/0/100/e multimedia Intel Corporation
/0/100/f communication Intel Corporation
/0/100/12 storage Intel Corporation
/0/100/13 bridge Intel Corporation
/0/100/13.1 bridge Intel Corporation
/0/100/13.2 bridge Intel Corporation
/0/100/13.2/0 enp3s0 network RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
/0/100/13.3 bridge Intel Corporation
/0/100/13.3/0 storage ASM1062 Serial ATA Controller
/0/100/15 bus Intel Corporation
/0/100/15/0 usb1 bus xHCI Host Controller
/0/100/15/0/3 generic 802.11n WLAN Adapter
/0/100/15/0/5 communication BT2.0
/0/100/15/0/6 bus NEC USB HUB (ASC)
/0/100/15/0/6/1 input 109 JPN USB KBD (ASC)
/0/100/15/0/6/3 input wireless dongle
/0/100/15/1 usb2 bus xHCI Host Controller
/0/100/1f bridge Intel Corporation
/0/100/1f.1 bus Intel Corporation
/0/1 scsi0 storage
/0/1/0.0.0 /dev/sda disk 240GB ADATA SP550
/0/1/0.0.0/1 /dev/sda1 volume 511MiB Windows FAT ボリューム
/0/1/0.0.0/2 /dev/sda2 volume 732MiB EXT4ボリューム
/0/1/0.0.0/3 /dev/sda3 volume 48GiB EFI partition
/0/1/0.0.0/4 /dev/sda4 volume 174GiB EXT4ボリューム
/1 vlan2 network イーサネット interface
/2 vlan10 network イーサネット interface
/3 vlan200 network イーサネット interface
/4 vlan30 network イーサネット interface
/5 wlx000b8181dc8e network 無線インターフェース
takuya@:~$