{"id":1472,"date":"2019-04-27T17:31:42","date_gmt":"2019-04-27T09:31:42","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=1472"},"modified":"2019-06-22T11:39:02","modified_gmt":"2019-06-22T03:39:02","slug":"dmesg","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/dmesg","title":{"rendered":"dmesg\u547d\u4ee4 – \u663e\u793a\u5f00\u673a\u4fe1\u606f"},"content":{"rendered":"\n

dmesg\u547d\u4ee4\u88ab\u7528\u4e8e\u68c0\u67e5\u548c\u63a7\u5236\u5185\u6838\u7684\u73af\u5f62\u7f13\u51b2\u533a\u3002kernel\u4f1a\u5c06\u5f00\u673a\u4fe1\u606f\u5b58\u50a8\u5728ring buffer\u4e2d\u3002\u60a8\u82e5\u662f\u5f00\u673a\u65f6\u6765\u4e0d\u53ca\u67e5\u770b\u4fe1\u606f\uff0c\u53ef\u5229\u7528dmesg\u6765\u67e5\u770b\u3002\u5f00\u673a\u4fe1\u606f\u4fdd\u5b58\u5728\/var\/log\/dmesg\u6587\u4ef6\u91cc\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>dmesg [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
-c <\/td>\u663e\u793a\u4fe1\u606f\u540e\uff0c\u6e05\u9664ring buffer\u4e2d\u7684\u5185\u5bb9<\/td><\/tr>
-s <\u7f13\u51b2\u533a\u5927\u5c0f> <\/td>\u9884\u8bbe\u7f6e\u4e3a8196\uff0c\u521a\u597d\u7b49\u4e8ering buffer\u7684\u5927\u5c0f<\/td><\/tr>
-n <\/td>\u8bbe\u7f6e\u8bb0\u5f55\u4fe1\u606f\u7684\u5c42\u7ea7<\/td><\/tr><\/tbody><\/table>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u641c\u7d22\u5f00\u673a\u4fe1\u606f\u7684\u5173\u952e\u8bcd\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# dmesg | grep sda<\/pre>\n\n\n\n

\u5ffd\u7565\u5927\u5c0f\u5199\u641c\u7d22\u5173\u952e\u8bcd:<\/p>\n\n\n\n

[root@linuxcool ~]# dmesg | grep -i memory <\/pre>\n\n\n\n

\u663e\u793a\u5f00\u673a\u4fe1\u606f\u7684\u524d20\u884c\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# dmesg | head -20<\/pre>\n\n\n\n

\u663e\u793a\u5f00\u673a\u4fe1\u606f\u7684\u6700\u540e20\u884c \uff1a<\/p>\n\n\n\n

[root@linuxcool  ~]# dmesg | tail -20<\/pre>\n\n\n\n

\u6e05\u7a7admesg\u73af\u5f62\u7f13\u51b2\u533a\u4e2d\u7684\u65e5\u5fd7\uff1a<\/p>\n\n\n\n

[root@linuxcool  ~]# dmesg -c<\/pre>\n\n\n\n

<\/p>\n","protected":false},"excerpt":{"rendered":"

dmesg\u547d\u4ee4\u88ab\u7528\u4e8e\u68c0\u67e5\u548c\u63a7\u5236\u5185\u6838\u7684\u73af\u5f62\u7f13\u51b2\u533a\u3002kernel\u4f1a\u5c06\u5f00\u673a\u4fe1\u606f\u5b58\u50a8\u5728ring buffer\u4e2d\u3002\u60a8\u82e5\u662f […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1472"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=1472"}],"version-history":[{"count":12,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1472\/revisions"}],"predecessor-version":[{"id":3359,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1472\/revisions\/3359"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=1472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=1472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=1472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}