linuxcpu核数查看
Ⅰ linux如何查看cpu核心数和内存大小
linux查看cpu核数和内存大罩御高小命令分别为:
1、查看CPU个数*核心数:
cat /proc/cpuinfo |grep“physical id” | uniq | wc -l
96 #一共96核
2、查看内存总数
#cat /proc/meminfo | grep MemTotal
MemTotal: 230993600 kB
Linux下查看CPU型号,内存大小,硬盘空间的命令:
1、查看CPU核数
cat /proc/cpuinfo | grep “cpu cores” | uniq
cpu cores : 12 #12是拆虚单颗CPU的核心数
2、查看CPU型号
cat /proc/cpuinfo | grep ‘model name’ |uniq
model name : Intel® Xeon® CPU E7-4830 v3 @ 2.10GHz
3、查看linux物理内存数量物尺及大小
dmidecode -t memory | grep Size: | grep -v “No Mole Installed”
Ⅱ linux镆ョ湅cpu涓鏁板拰镙稿绩鏁
cpu淇℃伅璁板綍鍦/proc/cpuinfo涓銆
linux镐庝箞镆ョ湅cpu镄勪釜鏁帮纻鎴戜滑涓璧锋潵浜呜В涓涓嫔惂銆傜涓绉嶆柟娉曪细top锻戒护娉曢栧厛镓ц宼op锻戒护銆傚湪top锻戒护镄勬樉绀虹晫闱锛屾寜鏁板瓧阌1锛屽嵆鍙镆ョ湅鍒板綋鍓岖郴缁熶腑镄勬籧pu鏁般
linux绯荤粺鏂规硶/姝ラ1/proc/cpuinfo链绠鍗旷殑鏂规硶灏辨槸镆ョ湅/proc/cpuinfo锛岃繖涓铏氭嫙鏂囦欢灞旷ず镄勬槸鍙鐢–PU纭浠剁殑閰岖疆銆
榧犳爣鍙抽敭镣瑰嚮妗岄溃锛岄夋嫨钬沧墦寮缁堢钬濓纴濡备笅锲炬墍绀恒傚厛杈揿叆锻戒护钬渃at/proc/cpuinfo钬濓纴铹跺悗鍐嶆寜锲炶溅阌灏辫兘鐪嫔埌链嶅姟鍣ㄧ殑CPU淇℃伅锛屽备笅锲炬墍绀恒
镆ヨ㈤昏緫CPU镐绘暟锛歝at/proc/cpuinfo|grepprocessor|wc-l璇风偣鍑昏緭鍏ュ浘鐗囨弿杩版渶钖庯纴缁椤ぇ瀹朵粙缁崭笅CPU鍨嫔彿镄勬煡璇㈡柟寮忋
1銆佺涓绉嶆柟娉曪细top锻戒护娉曢栧厛镓ц宼op锻戒护銆傚湪top锻戒护镄勬樉绀虹晫闱锛屾寜鏁板瓧阌1锛屽嵆鍙镆ョ湅鍒板綋鍓岖郴缁熶腑镄勬籧pu鏁般
2銆佹煡鐪媍pu镐讳釜鏁版柟娉曪细棣栧厛镓ц宼op锻戒护锛屽备笅锲句腑鍐呭规墍琛ㄧず銆傚湪top锻戒护镄勬樉绀虹晫闱锛屾寜鏁板瓧阌1锛屽嵆鍙镆ョ湅鍒板綋鍓岖郴缁熶腑镄勬籧pu鏁帮纴濡备笅锲句腑鍐呭规墍琛ㄧず銆
3銆侀栧厛鏄瀵逛簬CPU镄勮存槑链嶅姟鍣–PU镐ц兘鍙傛暟涓昏佷俊鎭鍙浠ラ氲繃镆ョ湅/proc/cpuinfo銮峰缑銆
4銆佹渶绠鍗旷殑鏂规硶灏辨槸镆ョ湅/proc/cpuinfo锛岃繖涓铏氭嫙鏂囦欢灞旷ず镄勬槸鍙鐢–PU纭浠剁殑閰岖疆銆傞氲繃镆ョ湅杩欎釜鏂囦欢锛屼綘鑳借瘑鍒鍑虹墿鐞嗗勭悊鍣ㄦ暟(鎻掓Ы)銆佹疮涓狢PU镙稿绩鏁般佸彲鐢ㄧ殑CPU镙囧织瀵勫瓨鍣ㄤ互鍙婂叾瀹冧笢瑗跨殑鏁伴噺銆
5銆佽风偣鍑昏緭鍏ュ浘鐗囨弿杩颁篃鍙浠ヤ娇鐢ㄥ备笅鏂瑰纺鍗旷嫭镆ヨCPU涓鏁般佹牳鏁板强阃昏緫CPU镐绘暟銆
1銆丆PU镄勪俊鎭瀛樻斁鍦/proc/cpuinfo涓锛屽备笅锲炬墍绀猴纴physicalid浠h〃绗鍑犱釜CPU锛岀紪鍙蜂粠0寮濮嬶纴cpucores浠h〃镙告暟锛屽彲浠ョ湅鍑烘槸1棰1镙哥殑CPU锛屽嵆CPU涓鏁版槸1涓銆
2銆乴inux镐庝箞镆ョ湅cpu镙告暟锛熸垜浠涓璧锋潵浜呜В涓涓嫔惂銆傛墦寮linux绯荤粺锛屽湪linux镄勬岄溃镄勭┖锏藉勫彸鍑汇傚湪寮瑰嚭镄勪笅𨰾夐夐”閲岋纴镣瑰嚮镓揿紑缁堢銆傝緭鍏cat/proc/cpuinfo锻戒护锛屽洖杞﹁繍琛岋纴鍏朵腑cpucores浠h〃镙告暟銆
3銆佹柟娉/姝ラlinux镄刢pu淇℃伅鍙浠ヤ粠鏂囦欢涓珰puinfo璇诲彇銆傛墽琛屽懡浠わ细cat/proc/cpuinfo璇风偣鍑昏緭鍏ュ浘鐗囨弿杩版垜浠涓鑸鐪嫔埌镄刾rocessor鏄阃昏緫镙搞
4銆乧pu淇℃伅璁板綍鍦/proc/cpuinfo涓銆
1銆乧pu淇℃伅璁板綍鍦/proc/cpuinfo涓銆
2銆乴inux镐庝箞镆ョ湅cpu镄勪釜鏁帮纻鎴戜滑涓璧锋潵浜呜В涓涓嫔惂銆傜涓绉嶆柟娉曪细top锻戒护娉曢栧厛镓ц宼op锻戒护銆傚湪top锻戒护镄勬樉绀虹晫闱锛屾寜鏁板瓧阌1锛屽嵆鍙镆ョ湅鍒板綋鍓岖郴缁熶腑镄勬籧pu鏁般
3銆佹墦寮xshell杞浠惰繛鎺ヤ笂linux链嶅姟鍣ㄣ傝緭鍏ユ寚浠ゃ恈at/proc/cpuinfo|grepname|cut-f2-d锛殀uniq-c銆戞煡鐪媍pu鍨嫔彿淇℃伅銆傜劧钖庤緭鍏ユ寚浠ゃ恎repphysicalid/proc/cpuinfo|sort|uniq|wc-l銆戣缮鍙浠ユ煡鐪媍pu鐗╃悊涓鏁般
4銆佹煡璇㈤昏緫CPU镐绘暟锛歝at/proc/cpuinfo|grepprocessor|wc-l璇风偣鍑昏緭鍏ュ浘鐗囨弿杩版渶钖庯纴缁椤ぇ瀹朵粙缁崭笅CPU鍨嫔彿镄勬煡璇㈡柟寮忋
5銆佹煡cpu鏁扮殑鏂规硶绗涓绉嶆柟娉曪细top锻戒护娉曞湪top锻戒护镄勬樉绀虹晫闱锛屾寜鏁板瓧阌1锛屽嵆鍙镆ョ湅鍒板綋鍓岖郴缁熶腑镄勬籧pu鏁帮纴濡备笅锲句负4镙哥殑cpu銆
镆ョ湅linux绯荤粺CPU淇℃伅镄勬柟娉曞伐鍏/铡熸枡linux绯荤粺鏂规硶/姝ラ1/proc/cpuinfo链绠鍗旷殑鏂规硶灏辨槸镆ョ湅/proc/cpuinfo锛岃繖涓铏氭嫙鏂囦欢灞旷ず镄勬槸鍙鐢–PU纭浠剁殑閰岖疆銆
Linux锻戒护琛屽彲浠ヤ娇鐢╰op鎴栬卾mstat锻戒护镆ョ湅绯荤粺镄凛PU鍜屽唴瀛树娇鐢ㄦ儏鍐点
鍦ㄧ数鑴戜腑杩涘叆Linux镎崭綔绯荤粺锛屾墦寮Linux锻戒护鐣岄溃銆傚湪Linux锻戒护鐣岄溃涓杈揿叆cat/proc/meminfo锻戒护钖庯纴鏁插嚮阌阌鐩桦洖杞﹂敭銆傚湪鏁插嚮瀹屽洖杞﹂敭钖庯纴鍑虹幇MemTotal鍜孧emFree鍒嗗埆灏辨槸鍙鏀閰嶅唴瀛桦拰绌洪棽鍐呭瓨浜嗐
linux濡备綍镆ョ湅cpu鍨嫔彿锛屼负鎭ㄦ彁渚沴inux濡备綍镆ョ湅cpu鍨嫔彿锲炬枃淇℃伅锛屾墦寮linux绯荤粺锛屽湪linux镄勬岄溃镄勭┖锏藉勫彸鍑汇傚湪寮瑰嚭镄勪笅𨰾夐夐”閲岋纴镣瑰嚮镓揿紑缁堢銆