• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# touch<a name="EN-US_TOPIC_0000001134006268"></a>
2
3-   [Command Function](#section17541924112716)
4-   [Syntax](#section866182711274)
5-   [Parameters](#section268912296270)
6-   [Usage](#section412093332714)
7-   [Example](#section414434814354)
8-   [Output](#section1028419515711)
9
10## Command Function<a name="section17541924112716"></a>
11
12-   This command is used to create an empty file in a specified directory.
13-   If this command is executed to create an existing file, the execution will be successful but the timestamp will not be updated.
14
15## Syntax<a name="section866182711274"></a>
16
17touch \[_filename_\]
18
19## Parameters<a name="section268912296270"></a>
20
21**Table  1**  Parameter description
22
23<a name="table1635mcpsimp"></a>
24<table><thead align="left"><tr id="row1642mcpsimp"><th class="cellrowborder" valign="top" width="20.73%" id="mcps1.2.4.1.1"><p id="p1653mcpsimp"><a name="p1653mcpsimp"></a><a name="p1653mcpsimp"></a><strong id="b132581435193918"><a name="b132581435193918"></a><a name="b132581435193918"></a>Parameter</strong></p>
25</th>
26<th class="cellrowborder" valign="top" width="52.44%" id="mcps1.2.4.1.2"><p id="p1655mcpsimp"><a name="p1655mcpsimp"></a><a name="p1655mcpsimp"></a><strong id="b88661537163918"><a name="b88661537163918"></a><a name="b88661537163918"></a>Description</strong></p>
27</th>
28<th class="cellrowborder" valign="top" width="26.83%" id="mcps1.2.4.1.3"><p id="p1657mcpsimp"><a name="p1657mcpsimp"></a><a name="p1657mcpsimp"></a><strong id="b164851738193910"><a name="b164851738193910"></a><a name="b164851738193910"></a>Value Range</strong></p>
29</th>
30</tr>
31</thead>
32<tbody><tr id="row1684mcpsimp"><td class="cellrowborder" valign="top" width="20.73%" headers="mcps1.2.4.1.1 "><p id="p1686mcpsimp"><a name="p1686mcpsimp"></a><a name="p1686mcpsimp"></a>filename</p>
33</td>
34<td class="cellrowborder" valign="top" width="52.44%" headers="mcps1.2.4.1.2 "><p id="p1688mcpsimp"><a name="p1688mcpsimp"></a><a name="p1688mcpsimp"></a>Specifies the name of the file to be created.</p>
35</td>
36<td class="cellrowborder" valign="top" width="26.83%" headers="mcps1.2.4.1.3 "><p id="p1690mcpsimp"><a name="p1690mcpsimp"></a><a name="p1690mcpsimp"></a>N/A</p>
37</td>
38</tr>
39</tbody>
40</table>
41
42## Usage<a name="section412093332714"></a>
43
44-   The  **touch**  command creates an empty file that is readable and writeable.
45-   The  **touch**  command creates only one file at a time.
46
47    >![](../public_sys-resources/icon-notice.gif) **NOTICE:**
48    >If you run the  **touch**  command to create a file in a path storing important system resources, unexpected results such as a system breakdown may occur. For example, if you run the  **touch uartdev-0**  command in the  **/dev**  path, the system may stop responding.
49
50
51## Example<a name="section414434814354"></a>
52
53Run  **touch file.c**.
54
55## Output<a name="section1028419515711"></a>
56
57**Figure  1**  Creating  **file.c**<a name="fig188183221532"></a>
58![](figure/creating-file-c.png "creating-file-c")
59
60