kernel-small-debug-shell-file-chown.md 3.8 KB
Newer Older
D
duangavin123 已提交
1
# chown<a name="EN-US_TOPIC_0000001179965847"></a>
W
wenjun 已提交
2 3 4 5 6 7 8 9 10

## Command Function<a name="section247414691513"></a>

This command is used to change the owner and group of a specified file.

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

chown \[_owner_\] \[_group_\] \[_pathname_\]

D
duangavin123 已提交
11
## Parameters<a name="section598731391517"></a>
W
wenjun 已提交
12

D
duangavin123 已提交
13
**Table  1**  Parameter description
W
wenjun 已提交
14 15 16 17 18 19 20 21 22 23 24 25

<a name="table1049mcpsimp"></a>
<table><thead align="left"><tr id="row1055mcpsimp"><th class="cellrowborder" valign="top" width="21%" id="mcps1.2.4.1.1"><p id="p1057mcpsimp"><a name="p1057mcpsimp"></a><a name="p1057mcpsimp"></a><strong id="b130925344111510"><a name="b130925344111510"></a><a name="b130925344111510"></a>Parameter</strong></p>
</th>
<th class="cellrowborder" valign="top" width="52%" id="mcps1.2.4.1.2"><p id="p1059mcpsimp"><a name="p1059mcpsimp"></a><a name="p1059mcpsimp"></a><strong id="b1226032904716"><a name="b1226032904716"></a><a name="b1226032904716"></a>Description</strong></p>
</th>
<th class="cellrowborder" valign="top" width="27%" id="mcps1.2.4.1.3"><p id="p1061mcpsimp"><a name="p1061mcpsimp"></a><a name="p1061mcpsimp"></a><strong id="b34190246311510"><a name="b34190246311510"></a><a name="b34190246311510"></a>Value Range</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="row1062mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1064mcpsimp"><a name="p1064mcpsimp"></a><a name="p1064mcpsimp"></a>owner</p>
</td>
D
duangavin123 已提交
26
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p13519122819294"><a name="p13519122819294"></a><a name="p13519122819294"></a>Specifies the file owner.</p>
W
wenjun 已提交
27 28 29 30 31 32
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p182181026104214"><a name="p182181026104214"></a><a name="p182181026104214"></a>[0, 0xFFFFFFFF]</p>
</td>
</tr>
<tr id="row172161126124218"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p68901524203516"><a name="p68901524203516"></a><a name="p68901524203516"></a>group</p>
</td>
D
duangavin123 已提交
33
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1066mcpsimp"><a name="p1066mcpsimp"></a><a name="p1066mcpsimp"></a>Specifies the file group.</p>
W
wenjun 已提交
34
</td>
D
duangavin123 已提交
35 36
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p81831811183618"><a name="p81831811183618"></a><a name="p81831811183618"></a>Left blank</p>
<p id="p1068mcpsimp"><a name="p1068mcpsimp"></a><a name="p1068mcpsimp"></a>[0, 0xFFFFFFFF]</p>
W
wenjun 已提交
37 38 39 40
</td>
</tr>
<tr id="row10616101153510"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p12217026154215"><a name="p12217026154215"></a><a name="p12217026154215"></a>pathname</p>
</td>
D
duangavin123 已提交
41
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p4218826194210"><a name="p4218826194210"></a><a name="p4218826194210"></a>Specifies the file path.</p>
W
wenjun 已提交
42 43 44 45 46 47 48 49 50 51
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p13872195215290"><a name="p13872195215290"></a><a name="p13872195215290"></a>An existing file</p>
</td>
</tr>
</tbody>
</table>

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

-   By specifying the  **owner**  and  **group**  parameters in this command, you can change the owner and group of the file.
D
duangavin123 已提交
52
-   If  **owner**  or  **group**  is  **-1**, the owner or group of the file will not be changed.
W
wenjun 已提交
53 54 55 56
-   The  **group**  parameter can be left blank.

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

D
duangavin123 已提交
57
Run  **chown 100 200 hello-harmony.txt**.
W
wenjun 已提交
58 59 60 61

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

**Figure  1**  Changing the owner and group of the hello-harmony.txt file to 100 and 200 respectively<a name="fig518593394920"></a>  
D
duangavin123 已提交
62
![](figure/changing-the-owner-and-group-of-the-hello-harmony-txt-file-to-100-and-200-respectively.png "changing-the-owner-and-group-of-the-hello-harmony-txt-file-to-100-and-200-respectively")
W
wenjun 已提交
63