• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# chmod<a name="EN-US_TOPIC_0000001179845927"></a>
2
3-   [Command Function](#section13992936121418)
4-   [Syntax](#section63342439147)
5-   [Parameter Description](#section894414671411)
6-   [Usage](#section182415221419)
7-   [Example](#section8518195718147)
8-   [Output](#section127391818158)
9
10## Command Function<a name="section13992936121418"></a>
11
12This command is used to change the file operation permission.
13
14## Syntax<a name="section63342439147"></a>
15
16chmod \[_mode_\] \[_pathname_\]
17
18## Parameter Description<a name="section894414671411"></a>
19
20**Table  1**  Parameters
21
22<a name="table1049mcpsimp"></a>
23<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="b144816543511718"><a name="b144816543511718"></a><a name="b144816543511718"></a>Parameter</strong></p>
24</th>
25<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="b1544627143010"><a name="b1544627143010"></a><a name="b1544627143010"></a>Description</strong></p>
26</th>
27<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="b44030524511718"><a name="b44030524511718"></a><a name="b44030524511718"></a>Value Range</strong></p>
28</th>
29</tr>
30</thead>
31<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>mode</p>
32</td>
33<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 permission for a file or directory. The value is an octal number, representing the permission of <strong id="b11602834153114"><a name="b11602834153114"></a><a name="b11602834153114"></a>User</strong> (owner), <strong id="b032113853120"><a name="b032113853120"></a><a name="b032113853120"></a>Group</strong> (group), or <strong id="b1980114418310"><a name="b1980114418310"></a><a name="b1980114418310"></a>Other</strong> (other groups).</p>
34</td>
35<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, 777]</p>
36</td>
37</tr>
38<tr id="row172161126124218"><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>
39</td>
40<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>
41</td>
42<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>
43</td>
44</tr>
45</tbody>
46</table>
47
48## Usage<a name="section182415221419"></a>
49
50Specify \[_mode_\] to change the file permission.
51
52## Example<a name="section8518195718147"></a>
53
54Run  **chmod 666 hello-harmony.txt**.
55
56## Output<a name="section127391818158"></a>
57
58**Figure  1**  Changing the permission for the  **hello-harmony.txt**  file to  **666**<a name="fig501223144912"></a>
59![](figure/changing-the-permission-for-the-hello-harmony-txt-file-to-666.png "changing-the-permission-for-the-hello-harmony-txt-file-to-666")
60
61