1e41f4b71Sopenharmony_ci# dmesg
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ci## Command Function
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ciThis command is used to display system boot and running information.
7e41f4b71Sopenharmony_ci
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci## Syntax
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_cidmesg
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_cidmesg [_-c/-C/-D/-E/-L/-U_]
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_cidmesg -s [_size_]
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_cidmesg -l [_level_]
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_cidmesg > [_fileA_]
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci
22e41f4b71Sopenharmony_ci## Parameters
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ci**Table 1** Parameter description
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci| Parameter           | Description                                | Value Range       |
27e41f4b71Sopenharmony_ci| --------------- | ---------------------------------------- | --------------- |
28e41f4b71Sopenharmony_ci| -c              | Prints content in the buffer and clears the buffer.            | N/A             |
29e41f4b71Sopenharmony_ci| -C              | Clears the buffer.                            | N/A             |
30e41f4b71Sopenharmony_ci| -D/-E           | Disables or enables printing to the console.                   | N/A             |
31e41f4b71Sopenharmony_ci| -L/-U           | Disables or enables printing via the serial port.                     | N/A             |
32e41f4b71Sopenharmony_ci| -s size    | Sets the size of the buffer. size specifies the buffer size to set.| N/A             |
33e41f4b71Sopenharmony_ci| -l level   | Sets the buffering level.                          | [0, 5] |
34e41f4b71Sopenharmony_ci| > fileA | Writes the content in the buffer to a file.            | N/A             |
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ci## Usage Guidelines
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ci- 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**.
40e41f4b71Sopenharmony_ci  Debug  ---> Enable a Debug Version ---> Enable Shell ---> Enable Shell dmesg
41e41f4b71Sopenharmony_ci
42e41f4b71Sopenharmony_ci- If no parameter is specified, all content in the buffer is printed.
43e41f4b71Sopenharmony_ci
44e41f4b71Sopenharmony_ci- The parameters followed by hyphens (-) are mutually exclusive.
45e41f4b71Sopenharmony_ci  1. Before writing content to a file, ensure that the file system has been mounted.
46e41f4b71Sopenharmony_ci  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.
47e41f4b71Sopenharmony_ci
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci## Example
50e41f4b71Sopenharmony_ci
51e41f4b71Sopenharmony_ciRun **dmesg> dmesg.log**.
52e41f4b71Sopenharmony_ci
53e41f4b71Sopenharmony_ci
54e41f4b71Sopenharmony_ci## Output
55e41f4b71Sopenharmony_ci
56e41f4b71Sopenharmony_ciWrite the content in the buffer to the **dmesg.log** file.
57e41f4b71Sopenharmony_ci
58e41f4b71Sopenharmony_ci```
59e41f4b71Sopenharmony_ciOHOS # dmesg > dmesg.log
60e41f4b71Sopenharmony_ciDmesg write log to dmesg.log success
61e41f4b71Sopenharmony_ci```
62