linux檢視系統屬性
阿新 • • 發佈:2020-06-30
Linux下獲取CPU記憶體資訊的命令
1. 獲取CPU型號資訊
cat /proc/cpuinfo | grep name | cut -f2 -d: |uniq -c
2.獲取CPU的個數(幾核CPU)
grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l #查詢CPU的物理個數。結果為2,說明CPU有兩個。 cat /proc/cpuinfo |grep "cores"|uniq #檢視CPU的核數。結果為2,說明一個CPU的有2個晶片組,總核數是4核。
擴充套件閱讀:
2.1.物理cpu數:主機板上實際插入的cpu數量,可以數不重複的 physical id 有幾個(physical id)
2.2.cpu核數:單塊CPU上面能處理資料的晶片組的數量,如雙核、四核等 (cpu cores)
3.檢視系統記憶體
cat /proc/meminfo | grep MemTotal
4.檢視作業系統版本
cat /etc/centos-release”或者是“cat /etc/issue”得到的資訊才是文件中要填的。得到的結果為“CentOS Linux release 7.5.1804 (Core)”。
一般文件中填的都是Linux CentOS7.5這個結果。
5.檢視硬碟大小
fdisk -l |grep Disk