demsg指令
功能說明
demsg指令用于顯示開機資訊,核心會将開機資訊存儲在系統緩沖區(ring buffer)中,開機後可用dmesg指令檢視,也可以在/var/log/目錄中檢視dmesg檔案。用法如下:
dmesg [選項]
指令參數
選項
含義
-c
顯示開機資訊後,清除ring buffer資訊
-s
設定緩沖區大小,預設設定為8192
-n
設定記錄資訊的層級
核心緩沖區的資訊對于診斷系統非常有用。在檢視時可以配合grep使用。
示例
使用tail檢視最後10條資訊
[root@c7 ~]# dmesg | tail
[ 14.173511] Ebtables v2.0 registered
[ 14.211151] Bridge firewalling registered
[ 15.018274] IPv6: ADDRCONF(NETDEV_UP): eno16777736: link is not ready
[ 15.023187] e1000: eno16777736 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
[ 15.027562] IPv6: ADDRCONF(NETDEV_UP): eno16777736: link is not ready
[ 15.027571] IPv6: ADDRCONF(NETDEV_CHANGE): eno16777736: link becomes ready
[73937.594566] e1000: eno16777736 NIC Link is Down
[74082.150628] e1000: eno16777736 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
[74082.153014] IPv6: ADDRCONF(NETDEV_CHANGE): eno16777736: link becomes ready
[102547.555629] perf interrupt took too long (2547 > 2500), lowering kernel.perf_event_max_sample_rate to 50000
使用grep檢視關于網卡裝置的資訊
[root@c7 ~]# dmesg | grep eno16
[ 2.834942] systemd-udevd[497]: renamed network interface eth0 to eno16777736
本文轉自cix123 51CTO部落格,原文連結:http://blog.51cto.com/zhaodongwei/1874169,如需轉載請自行聯系原作者