linux command – discover

Loading

測試環境為 Ubuntu 16.04 x86_64

#discover 功能類似
# lshw – list hardware https://benjr.tw/53000
透過 lshw 的功能可以檢視系統的硬體設施. 包括記憶體組態 (memory configuration),韌體版本 (firmware version),主機板組態 (mainboard configuration),處理器版本以及速度 (CPU version and speed),快取組態 (cache configuration),匯流排速度 (bus speed), 等…..

# lspci – list all PCI devices
常用來看 PCI-(E) Bus 的系統硬體相關訊息的指令.
https://benjr.tw/10851 (透過 #lspci 查詢目前系統所有 PCI / PCI-E 的裝置)
https://benjr.tw/10842 (透過 #lspci 查詢 PCI-E Bus 匯流排速度)

discover 非預設安裝,在 Ubuntu 下可以直接透過 apt 來安裝.

root@ubuntu:~# apt install discover

下面介紹幾個 discover 常用的參數:
-b | –bus-summary
這是預設選項,可以依據匯流排來顯示所有設備的基本資訊,或是指定某一種 匯流排 ( ata , pci , pcmcia , scsi , usb )
只檢視關於 usb 匯流排的裝置.

root@ubuntu:~# discover --bus-summary usb
unknown unknown 
VMware, Inc. Virtual USB Hub 
VMware, Inc. Virtual Mouse 
Linux Foundation 1.1 root hub 
unknown unknown 
Linux Foundation 2.0 root hub 

在 /etc/discover.conf.d/00discover 定義預設 –bus-summary 要顯示的全部匯流排裝置,可以透過參數來設定 –disable-bus (排除) 及 –enable-bus (包含)

顯示所有匯流排的裝置,但排除關於 scsi 的部分.

root@ubuntu:~# discover --bus-summary --disable-bus scsi

-t | –type-summary
這邊是以裝置的種類來區分,種類參數 audio , bridge , broadband , display , fixeddisk , humaninput , imaging , miscellaneous , modem , network , optical , printer , removabledisk , tape , video
顯示所有關於網路的裝置

root@ubuntu:~# discover --type-summary network
Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) 

–vendor-id , –model-id
預設會顯示 –vendor 及 –model,如果要看其裝置 ID 需要使用這兩個參數,在 Linux 使用 Class ID + Vendor ID + Device (model) ID 來代表裝置,如剛剛的 Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) 所代表裝置名稱為 Class ID = 0200 (discover 無法顯示),Vendor ID = 8086 ,Device ID =100f.

root@ubuntu:~# discover --type-summary network --vendor-id --model-id
8086 100f Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

0200 : class 0200 表示是 “Network controller”
8086 : vendor ID 8086 製造廠商 “Intel Corporation”
100f : device ID 1659 產品名稱 “82545EM Gigabit Ethernet Controller (Copper)”

下面幾個參數是關於 vendor 及 Device (model)
–model | –no-model
–model-id | –no-model-id
–vendor | –no-vendor
–vendor-id | –no-vendor-id

更多關於 discover 的參數使用可以參考 #man discover 或是 http://manpages.ubuntu.com/manpages/xenial/man1/discover.1.html

沒有解決問題,試試搜尋本站其他內容

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料