dmesg
顯示Linux系統啓動信息
補充說明
dmesg命令 被用於檢查和控制內核的環形緩衝區。kernel會將開機信息存儲在ring buffer中。您若是開機時來不及查看信息,可利用dmesg來查看。開機信息保存在/var/log/dmesg
文件裏。
語法
1dmesg(選項)
選項
1-c:顯示信息後,清除ring buffer中的內容;
2-s<緩衝區大小>:預設置爲8196,剛好等於ring buffer的大小;
3-n:設置記錄信息的層級。
實例
1[root@localhost ~]# dmesg | head
2Linux version 2.6.18-348.6.1.el5 (mockbuild@builder17.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)) #1 SMP Tue May 21 15:34:22 EDT 2013
3BIOS-provided physical RAM map:
4 BIOS-e820: 0000000000010000 - 000000000009f400 (usable)
5 BIOS-e820: 000000000009f400 - 00000000000a0000 (reserved)
6 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
7 BIOS-e820: 0000000000100000 - 000000007f590000 (usable)
8 BIOS-e820: 000000007f590000 - 000000007f5e3000 (ACPI NVS)
9 BIOS-e820: 000000007f5e3000 - 000000007f5f0000 (ACPI data)
10 BIOS-e820: 000000007f5f0000 - 000000007f600000 (reserved)
11 BIOS-e820: 00000000e0000000 - 00000000e8000000 (reserved)
查看硬盤基礎信息
1dmesg | grep sda
2
3[ 2.442555] sd 0:0:0:0: [sda] 488281250 512-byte logical blocks: (250 GB/232 GiB)
4[ 2.442590] sd 0:0:0:0: [sda] Write Protect is off
5[ 2.442592] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
6[ 2.442607] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
7[ 2.447533] sda: sda1
8[ 2.448503] sd 0:0:0:0: [sda] Attached SCSI disk
查看多關鍵字
1dmesg | grep -E "vcc5v0_host|vcc_3v3_s0|ttyS"
2
3[ 1.193143] vcc5v0_host: supplied by vcc5v0_usb
4[ 1.481139] feb80000.serial: ttyS5 at MMIO 0xfeb80000 (irq = 73, base_baud = 1500000) is a 16550A
5[ 1.513541] vcc_3v3_s0: supplied by vcc5v0_sys
來源:https://github.com/jaywcjlove/linux-command
最後修改於: Wednesday, January 31, 2024
版權申明:
- 未標註來源的內容皆為原創,未經授權請勿轉載(因轉載後排版往往錯亂、內容不可控、無法持續更新等);
- 非營利為目的,演繹本博客任何內容,請以'原文出處'或者'參考鏈接'等方式給出本站相關網頁地址(方便讀者)。