kernel-small-debug-shell-cmd-uname.md 4.8 KB
Newer Older
A
Annie_wang 已提交
1
# uname
D
duangavin123 已提交
2

D
duangavin123 已提交
3 4
## Command Function<a name="section107697383115"></a>

D
duangavin123 已提交
5
This command is used to display the name, version creation time, system name, and version information of the current operating system.
D
duangavin123 已提交
6 7 8

## Syntax<a name="section162824341116"></a>

D
duangavin123 已提交
9
uname \[_-a | -s | -r | -m | -n | -v | --help_\]
D
duangavin123 已提交
10 11 12 13 14 15 16 17 18 19

**Table  1**  Parameters

<a name="table909mcpsimp"></a>
<table><thead align="left"><tr id="row914mcpsimp"><th class="cellrowborder" valign="top" width="33.989999999999995%" id="mcps1.2.3.1.1"><p id="p916mcpsimp"><a name="p916mcpsimp"></a><a name="p916mcpsimp"></a>Parameter</p>
</th>
<th class="cellrowborder" valign="top" width="66.01%" id="mcps1.2.3.1.2"><p id="p918mcpsimp"><a name="p918mcpsimp"></a><a name="p918mcpsimp"></a>Parameters</p>
</th>
</tr>
</thead>
D
duangavin123 已提交
20 21 22 23 24 25 26 27
<tbody><tr id="row7659172561412"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p9648112519147"><a name="p9648112519147"></a><a name="p9648112519147"></a>--help</p>
</td>
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p1664862551411"><a name="p1664862551411"></a><a name="p1664862551411"></a>Displays help information.</p>
</td>
</tr>
<tr id="row365962510147"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p26489259149"><a name="p26489259149"></a><a name="p26489259149"></a>No parameter</p>
</td>
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p186484252141"><a name="p186484252141"></a><a name="p186484252141"></a>Displays the operating system name by default.</p>
D
duangavin123 已提交
28
</td>
D
duangavin123 已提交
29 30 31 32
</tr>
<tr id="row12659142511413"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p156481253140"><a name="p156481253140"></a><a name="p156481253140"></a>-a</p>
</td>
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p864872512145"><a name="p864872512145"></a><a name="p864872512145"></a>Displays all information.</p>
D
duangavin123 已提交
33 34
</td>
</tr>
D
duangavin123 已提交
35
<tr id="row365917254143"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p136481625131417"><a name="p136481625131417"></a><a name="p136481625131417"></a>-s</p>
D
duangavin123 已提交
36
</td>
D
duangavin123 已提交
37
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p1064852514149"><a name="p1064852514149"></a><a name="p1064852514149"></a>Displays the operating system name.</p>
D
duangavin123 已提交
38 39
</td>
</tr>
D
duangavin123 已提交
40
<tr id="row196591425101413"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p364814255144"><a name="p364814255144"></a><a name="p364814255144"></a>-r</p>
D
duangavin123 已提交
41
</td>
D
duangavin123 已提交
42
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p1564872515145"><a name="p1564872515145"></a><a name="p1564872515145"></a>Displays the kernel release version.</p>
D
duangavin123 已提交
43 44
</td>
</tr>
D
duangavin123 已提交
45
<tr id="row10659202591419"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p11648162520146"><a name="p11648162520146"></a><a name="p11648162520146"></a>-m</p>
D
duangavin123 已提交
46
</td>
D
duangavin123 已提交
47
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p136489251143"><a name="p136489251143"></a><a name="p136489251143"></a>Displays the operating system architecture name.</p>
D
duangavin123 已提交
48 49
</td>
</tr>
D
duangavin123 已提交
50
<tr id="row126582025111417"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p13648102551411"><a name="p13648102551411"></a><a name="p13648102551411"></a>-n</p>
D
duangavin123 已提交
51
</td>
D
duangavin123 已提交
52
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p6648132512141"><a name="p6648132512141"></a><a name="p6648132512141"></a>Displays the network domain name of the host.</p>
D
duangavin123 已提交
53 54
</td>
</tr>
D
duangavin123 已提交
55
<tr id="row3658925151415"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p9648152501414"><a name="p9648152501414"></a><a name="p9648152501414"></a>-v</p>
D
duangavin123 已提交
56
</td>
D
duangavin123 已提交
57
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p46489250149"><a name="p46489250149"></a><a name="p46489250149"></a>Displays version information.</p>
D
duangavin123 已提交
58 59 60 61 62 63 64
</td>
</tr>
</tbody>
</table>

## Usage<a name="section2652124861114"></a>

D
duangavin123 已提交
65 66
-   The  **uname**  command displays the name of the current operating system by default.
-   Except  **--help**  and  **-a**, other parameters can be used together.  **uname -a**  is equivalent to  **uname -srmnv**.
D
duangavin123 已提交
67 68 69

## Example<a name="section0107995132"></a>

D
duangavin123 已提交
70 71 72 73
Run the following commands:

-   uname -a
-   uname -ms
D
duangavin123 已提交
74 75 76

## Output<a name="section1215113245511"></a>

D
duangavin123 已提交
77 78 79 80
Example 1: all information of the operating system

```
OHOS:/$ uname -a
81
LiteOS hisilicon  *IP Address* Huawei LiteOS *IP Address*  Oct 21 2021 17:39:32 Cortex-A7
D
duangavin123 已提交
82 83 84 85
OHOS:/$
```

Example 2: operating system name and architecture
D
duangavin123 已提交
86

D
duangavin123 已提交
87 88
```
OHOS:/$ uname -ms
89
LiteOS Cortex-A7
D
duangavin123 已提交
90 91
OHOS:/$
```
D
duangavin123 已提交
92