{"id":23311,"date":"2025-04-19T07:32:01","date_gmt":"2025-04-18T23:32:01","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/23311.html"},"modified":"2025-04-19T07:32:01","modified_gmt":"2025-04-18T23:32:01","slug":"shell%e6%9f%a5%e7%9c%8b%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%9a%84%e5%86%85%e5%ad%98%e5%92%8ccpu%e6%80%bb%e9%87%8f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/23311.html","title":{"rendered":"shell\u67e5\u770b\u670d\u52a1\u5668\u7684\u5185\u5b58\u548cCPU\u603b\u91cf"},"content":{"rendered":"<p>\u5728 Linux \u7cfb\u7edf\u4e2d&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u670d\u52a1\u5668\u7684\u5185\u5b58\u548c CPU \u603b\u91cf&#xff1a;<\/p>\n<h4>\u67e5\u770b\u5185\u5b58\u603b\u91cf<\/h4>\n<li>\n<p>\u4f7f\u7528 free \u547d\u4ee4&#xff1a;<\/p>\n<p> <span class=\"token function\">free<\/span> -h<\/p>\n<p>\u8f93\u51fa\u793a\u4f8b&#xff1a;<\/p>\n<p>               total        used        free      shared  buff\/cache   available<br \/>\nMem:           31Gi       12Gi       10Gi       1.0Gi       9.0Gi        17Gi<br \/>\nSwap:         2.0Gi       0.5Gi       1.5Gi<\/p>\n<ul>\n<li>Mem \u884c\u4e2d\u7684 total \u5217\u8868\u793a\u5185\u5b58\u603b\u91cf\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u67e5\u770b\u5185\u5b58\u8be6\u7ec6\u4fe1\u606f&#xff1a;<\/p>\n<p> <span class=\"token function\">cat<\/span> \/proc\/meminfo<\/p>\n<p>\u7b2c\u4e00\u884c MemTotal \u8868\u793a\u603b\u5185\u5b58\u5927\u5c0f&#xff0c;\u5355\u4f4d\u662f KB\u3002<\/p>\n<\/li>\n<hr \/>\n<h4>\u67e5\u770b CPU \u603b\u91cf<\/h4>\n<li>\n<p>\u4f7f\u7528 lscpu \u547d\u4ee4&#xff1a;<\/p>\n<p> lscpu<\/p>\n<p>\u8f93\u51fa\u793a\u4f8b&#xff1a;<\/p>\n<p> Architecture:        x86_64<br \/>\nCPU(s):              8<br \/>\nThread(s) per core:  2<br \/>\nCore(s) per socket:  4<br \/>\nSocket(s):           1<\/p>\n<ul>\n<li>CPU(s) \u8868\u793a CPU \u7684\u603b\u903b\u8f91\u6838\u5fc3\u6570\u3002<\/li>\n<li>Core(s) per socket \u548c Socket(s) \u53ef\u4ee5\u8ba1\u7b97\u7269\u7406\u6838\u5fc3\u6570\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u76f4\u63a5\u67e5\u770b \/proc\/cpuinfo&#xff1a;<\/p>\n<p> <span class=\"token function\">cat<\/span> \/proc\/cpuinfo <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token string\">&#039;processor&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">wc<\/span> -l<\/p>\n<p>\u8fd9\u6761\u547d\u4ee4\u7edf\u8ba1\u903b\u8f91 CPU \u6838\u5fc3\u6570\u3002<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528 top \u6216 htop \u76d1\u63a7&#xff1a;<\/p>\n<ul>\n<li>\u8f93\u5165 top \u6216 htop \u547d\u4ee4&#xff0c;\u53ef\u4ee5\u67e5\u770b\u5b9e\u65f6\u7684 CPU \u4f7f\u7528\u7387\u4ee5\u53ca\u6838\u5fc3\u603b\u6570\u3002<\/li>\n<\/ul>\n<\/li>\n<hr \/>\n<h4>\u7b80\u5355\u603b\u7ed3<\/h4>\n<ul>\n<li>\u5185\u5b58\u603b\u91cf&#xff1a;free -h \u6216\u67e5\u770b \/proc\/meminfo\u3002<\/li>\n<li>CPU \u603b\u91cf&#xff1a;lscpu \u6216\u7edf\u8ba1 \/proc\/cpuinfo \u4e2d\u7684 processor\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb954\u6b21\uff0c\u70b9\u8d5e13\u6b21\uff0c\u6536\u85cf3\u6b21\u3002\u5185\u5b58\u603b\u91cffree -h\u6216\u67e5\u770b\u3002CPU \u603b\u91cflscpu\u6216\u7edf\u8ba1\u4e2d\u7684processor\u3002_shell \u83b7\u53d6\u673a\u5668\u5185\u5b58<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[679,58,534,43,44],"topic":[],"class_list":["post-23311","post","type-post","status-publish","format-standard","hentry","category-server","tag-cpu","tag-linux","tag-534","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>shell\u67e5\u770b\u670d\u52a1\u5668\u7684\u5185\u5b58\u548cCPU\u603b\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/23311.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"shell\u67e5\u770b\u670d\u52a1\u5668\u7684\u5185\u5b58\u548cCPU\u603b\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb954\u6b21\uff0c\u70b9\u8d5e13\u6b21\uff0c\u6536\u85cf3\u6b21\u3002\u5185\u5b58\u603b\u91cffree -h\u6216\u67e5\u770b\u3002CPU \u603b\u91cflscpu\u6216\u7edf\u8ba1\u4e2d\u7684processor\u3002_shell \u83b7\u53d6\u673a\u5668\u5185\u5b58\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/23311.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T23:32:01+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/23311.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/23311.html\",\"name\":\"shell\u67e5\u770b\u670d\u52a1\u5668\u7684\u5185\u5b58\u548cCPU\u603b\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T23:32:01+00:00\",\"dateModified\":\"2025-04-18T23:32:01+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/23311.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/23311.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/23311.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"shell\u67e5\u770b\u670d\u52a1\u5668\u7684\u5185\u5b58\u548cCPU\u603b\u91cf\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"shell\u67e5\u770b\u670d\u52a1\u5668\u7684\u5185\u5b58\u548cCPU\u603b\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/23311.html","og_locale":"zh_CN","og_type":"article","og_title":"shell\u67e5\u770b\u670d\u52a1\u5668\u7684\u5185\u5b58\u548cCPU\u603b\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb954\u6b21\uff0c\u70b9\u8d5e13\u6b21\uff0c\u6536\u85cf3\u6b21\u3002\u5185\u5b58\u603b\u91cffree -h\u6216\u67e5\u770b\u3002CPU \u603b\u91cflscpu\u6216\u7edf\u8ba1\u4e2d\u7684processor\u3002_shell \u83b7\u53d6\u673a\u5668\u5185\u5b58","og_url":"https:\/\/www.wsisp.com\/helps\/23311.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T23:32:01+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/23311.html","url":"https:\/\/www.wsisp.com\/helps\/23311.html","name":"shell\u67e5\u770b\u670d\u52a1\u5668\u7684\u5185\u5b58\u548cCPU\u603b\u91cf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T23:32:01+00:00","dateModified":"2025-04-18T23:32:01+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/23311.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/23311.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/23311.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"shell\u67e5\u770b\u670d\u52a1\u5668\u7684\u5185\u5b58\u548cCPU\u603b\u91cf"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/23311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=23311"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/23311\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=23311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=23311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=23311"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=23311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}