linux查看硬件配置命令



 

1、查看服務器的CPU

  • 查看CPU信息:cat /proc/cpuinfo
  • 物理cpu個數:cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
  • 每個物理cpu中core的個數(即核數):cat /proc/cpuinfo | grep "cpu cores" | uniq

  服務器的邏輯CPU = 物理個數 * 核數

2、查看服務器的內存情況 

  [root@localhost ~]# free -h
      total     used      free      shared       buff/cache        available
  Mem:     15G     857M     12G   23M           1.5G                 13G

  參數解釋:

  • total 內存總數
  • used 已經使用的內存數
  • free 空閑的內存數
  • shared 多個進程共享的內存總額
  • buffers Buffer Cache和cached Page Cache 磁盤緩存的大小
  • -buffers/cache (已用)的內存數:used - buffers - cached
  • +buffers/cache(可用)的內存數:free + buffers + cached
  • 可用的memory=free memory+buffers+cached

3、服務器磁盤使用情況

  • 查看當前硬盤使用情況: df –h
  • 查看硬盤性能:iostat -x 1 10

4、查看環境變量

  • 查看環境變量:env 

5、網絡

  • 查看所有網絡接口的屬性:ifconfig 
  • 查看防火牆設置:iptables -L
  • 查看路由表:route -n
  • 查看所有監聽端口:netstat -lntp
  • 查看所有已經建立的連接:netstat -antp
  • 查看網絡統計信息:netstat -s

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM