1# dmesg 2 3 4## Command Function 5 6This command is used to display system boot and running information. 7 8 9## Syntax 10 11dmesg 12 13dmesg [_-c/-C/-D/-E/-L/-U_] 14 15dmesg -s [_size_] 16 17dmesg -l [_level_] 18 19dmesg > [_fileA_] 20 21 22## Parameters 23 24**Table 1** Parameter description 25 26| Parameter | Description | Value Range | 27| --------------- | ---------------------------------------- | --------------- | 28| -c | Prints content in the buffer and clears the buffer. | N/A | 29| -C | Clears the buffer. | N/A | 30| -D/-E | Disables or enables printing to the console. | N/A | 31| -L/-U | Disables or enables printing via the serial port. | N/A | 32| -s size | Sets the size of the buffer. size specifies the buffer size to set.| N/A | 33| -l level | Sets the buffering level. | [0, 5] | 34| > fileA | Writes the content in the buffer to a file. | N/A | 35 36 37## Usage Guidelines 38 39- This command can be used only after **LOSCFG_SHELL_DMESG** is enabled. To enable **LOSCFG_SHELL_DMESG**, run the **make menuconfig** command in **kernel/liteos_a**. In the displayed dialog box, locate the **Debug** option and set **Enable Shell dmesg** to **Yes**. 40 Debug ---> Enable a Debug Version ---> Enable Shell ---> Enable Shell dmesg 41 42- If no parameter is specified, all content in the buffer is printed. 43 44- The parameters followed by hyphens (-) are mutually exclusive. 45 1. Before writing content to a file, ensure that the file system has been mounted. 46 2. Disabling the serial port printing will adversely affect shell. You are advised to set up a connection using Telnet before disabling the serial port. 47 48 49## Example 50 51Run **dmesg> dmesg.log**. 52 53 54## Output 55 56Write the content in the buffer to the **dmesg.log** file. 57 58``` 59OHOS # dmesg > dmesg.log 60Dmesg write log to dmesg.log success 61``` 62