如何查看LINUX 硬體設定資訊

來源:互聯網
上載者:User

1.查看機器所有硬體資訊:

dmidecode |more

dmesg |more

這2個命令出來的資訊都非常多,所以建議後面使用"|more"便於查看

2.查看CPU資訊

   方法一:
   Linux下CPU相關的參數儲存在 /proc/cpuinfo 檔案裡
   cat /proc/cpuinfo |more
   方法二:
   採用命令 dmesg | grep CPU 可以查看到相關CPU的啟動資訊
   查看CPU的位元:

   getconf LONG_BIT

3.查看Mem資訊

 cat /proc/meminfo |more (注意輸出資訊的最後一行:MachineMem:   41932272 kB)

 free -m

 top

4.查看磁碟資訊

   方法一:
   fdisk -l 可以看到系統上的磁碟(包括隨身碟)的分區以及大小相關資訊。
   方法二:
   直接查看

   cat /proc/partitions

5.查看網卡資訊

   方法一:
   ethtool eth0 採用此命令可以查看到網卡相關的技術指標
   (不一定所有網卡都支援此命令)
   ethtool -i eth1 加上 -i 參數查看網卡驅動
   可以嘗試其它參數查看網卡相關技術參數
   方法二:
   也可以通過dmesg | grep eth0 等看到網卡名字(廠家)等資訊
   通過查看 /etc/sysconfig/network-scripts/ifcfg-eth0 可以看到當前的網卡配置包括IP、網關地址等資訊。
   當然也可以通過ifconfig命令查看。

6.如何查看主板資訊?
 lspci

7.如何掛載ISO檔案
mount -o loop *.iso mount_point
8.如何查看光碟片相關資訊
   方法一:
   插入CD光碟後,在本人的RHEL5系統裡,光碟檔案是 /dev/cdrom,
   因此只需 mount /dev/cdrom mount_point 即可。
   [root@miix tmp]# mount /dev/cdrom mount_point
   mount: block device /dev/cdrom is write-protected, mounting read-only
   其實仔細看一下,光碟機的裝置檔案是 hdc 
   [root@miix tmp]# ls -l /dev/cdrom*
   lrwxrwxrwx 1 root root 3 01-08 08:54 /dev/cdrom -> hdc
   lrwxrwxrwx 1 root root 3 01-08 08:54 /dev/cdrom-hdc -> hdc
   因此我們也可以這樣 mount /dev/hdc mount_point
   如果光碟機裡沒放入有效光碟片,則報錯:
   [root@miix tmp]# mount /dev/hdc mount_point
   mount: 找不到介質
9.如何查看USB裝置相關

   方法一:
   其實通過 fdisk -l 命令可以查看到接入的隨身碟資訊,本人的隨身碟資訊如下:
   
   Disk /dev/sda: 2012 MB, 2012217344 bytes
   16 heads, 32 sectors/track, 7676 cylinders
   Units = cylinders of 512 * 512 = 262144 bytes
   
      Device Boot      Start         End      Blocks   Id  System
   /dev/sda1   *          16        7676     1961024    b  W95 FAT32
   
   隨身碟的裝置檔案是 /dev/sda,2G大小,FAT32格式。
   
   如果使用者登陸的不是Linux圖形介面,隨身碟不會自動掛載上來。
   此時可以通過手工掛載(mount):
   mount /dev/sda1 mount_point
   以上命令將隨身碟掛載到目前的目錄的 mount_point 目錄,注意掛的是 sda1 不是 sda。
   卸載命令是 umount mount_point
   
   Linux預設沒有內建支援NTFS格式磁碟的驅動,但對FAT32支援良好,掛載的時候一般不需要 -t vfat 參數 。
   如果支援ntfs,對ntfs格式的磁碟分割應使用 -t ntfs 參數。
   如果出現亂碼情況,可以考慮用 -o iocharset=字元集 參數。
   
   可以通過 lsusb 命令查看 USB 裝置資訊哦:
   
   [root@miix tmp]# lsusb
   Bus 001 Device 001: ID 0000:0000
   Bus 002 Device 001: ID 0000:0000
   Bus 003 Device 001: ID 0000:0000
   Bus 004 Device 002: ID 0951:1613 Kingston Technology
   Bus 004 Device 001: ID 0000:0000

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.