linux查詢硬體所有資訊

2021-10-08 13:58:31 字數 1587 閱讀 5745

1.檢視cpu資訊

#檢視cpu詳情資訊

lscpu

`lscpu |

grep

"model name"

|awk''`

`dmidecode |

grep -a16 "memory device$"

`

1.檢視磁碟型號

#以檔案形式檢視磁碟資訊

`cat /sys/block/nvme0n1/device/model`

intel ssdpe2mw012t4

或apt install smartmontools

smartctl --all /dev/sda

`lshw -c display |

grep

"product:"

|awk -f ":"''`

`dmidecode |

grep -a16 "system information$"

|grep

"product name:"

|head -n 1|

awk -f ":"''`

#!/bin/bash

host=

`getilip`

(getilip自己可以寫指令碼獲取ip編譯為命令)

cpu=

`lscpu |

grep

"model name"

|awk''`

mem1=

`dmidecode |

grep -a16 "memory device$"

|grep

"part number: vma"

|wc -l`

mem2=

`dmidecode |

grep -a16 "memory device$"

|grep

"part number: cm4"

|wc -l`

disk=

`cat /sys/block/nvme0n1/device/model`

disknumber=

`lsblk |

grep disk|

wc -l`

zhuban=

`dmidecode |

grep -a16 "system information$"

|grep

"product name:"

|head -n 1|

awk -f ":"''`

gpu=

`lshw -c display |

grep

"product:"

|awk -f ":"''`

echo

"host:$host,cpu:$cpu,主機板:$zhuban,阿斯嘉特:$mem1,海盜船:$mem2,disk:$disk,磁碟數量:$disknumber,gpu:$gpu"

Linux查詢系統硬體資訊命令

1.檢視伺服器型號 序列號 dmidecode grep system information a9 egrep manufacturer product serial manufacturer huawei product name rh2288 v3 serial number 2102310y...

Linux查詢硬體資訊命令整理

之前整理的不知道哪去了,在這裡再整理一次。記憶體 free m cat proc meminfo dmidecode t memory cpu lscpu cat proc cpuinfo dmidecode t processor dmidecode grep cpu 獲取cpu資訊 硬碟 df ...

Linux檢視硬體資訊

在linux環境開發驅動程式,首先要探測到新硬體,接下來就是開發驅動程式。常用命令整理如下 用硬體檢測程式kudzu探測新硬體 service kudzu start or restart 檢視cpu資訊 cat proc cpuinfo 檢視板卡資訊 cat proc pci 檢視pci資訊 ls...