提交 cab432c0 编写于 作者: O openharmony_ci 提交者: Gitee

!781 shell命令使用文档更新

Merge pull request !781 from Kiita/toybox_docs_1022
......@@ -9,7 +9,7 @@
## 命令功能<a name="section56472016338"></a>
date命令用于查询及设置系统日期和时间。
date命令用于查询系统日期和时间。
## 命令格式<a name="section16635112512316"></a>
......@@ -19,22 +19,19 @@ date --help
date +\[_Format_\]
date -s_ _\[_YY/MM/DD_\]
date_ _-s_ _\[_hh:mm:ss_\]__
date -r \[_Filename_\]
date -u
## 参数说明<a name="section15896030039"></a>
**表 1** 参数说明
<a name="table3825mcpsimp"></a>
<table><thead align="left"><tr id="row3831mcpsimp"><th class="cellrowborder" valign="top" width="21%" id="mcps1.2.4.1.1"><p id="p3833mcpsimp"><a name="p3833mcpsimp"></a><a name="p3833mcpsimp"></a>参数</p>
</th>
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.4.1.2"><p id="p3835mcpsimp"><a name="p3835mcpsimp"></a><a name="p3835mcpsimp"></a>参数说明</p>
</th>
<th class="cellrowborder" valign="top" width="28.999999999999996%" id="mcps1.2.4.1.3"><p id="p3837mcpsimp"><a name="p3837mcpsimp"></a><a name="p3837mcpsimp"></a>取值范围</p>
<th class="cellrowborder" valign="top" width="29%" id="mcps1.2.4.1.3"><p id="p3837mcpsimp"><a name="p3837mcpsimp"></a><a name="p3837mcpsimp"></a>取值范围</p>
</th>
</tr>
</thead>
......@@ -42,35 +39,21 @@ date -r \[_Filename_\]
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.4.1.2 "><p id="p3842mcpsimp"><a name="p3842mcpsimp"></a><a name="p3842mcpsimp"></a>使用帮助。</p>
</td>
<td class="cellrowborder" valign="top" width="28.999999999999996%" headers="mcps1.2.4.1.3 "><p id="p3844mcpsimp"><a name="p3844mcpsimp"></a><a name="p3844mcpsimp"></a>N/A</p>
<td class="cellrowborder" valign="top" width="29%" headers="mcps1.2.4.1.3 "><p id="p3844mcpsimp"><a name="p3844mcpsimp"></a><a name="p3844mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row3845mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3847mcpsimp"><a name="p3847mcpsimp"></a><a name="p3847mcpsimp"></a>+Format</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.4.1.2 "><p id="p3849mcpsimp"><a name="p3849mcpsimp"></a><a name="p3849mcpsimp"></a>根据<strong id="b3850mcpsimp"><a name="b3850mcpsimp"></a><a name="b3850mcpsimp"></a>Format</strong>格式打印日期和时间。</p>
</td>
<td class="cellrowborder" valign="top" width="28.999999999999996%" headers="mcps1.2.4.1.3 "><p id="p3852mcpsimp"><a name="p3852mcpsimp"></a><a name="p3852mcpsimp"></a>--help中列出的占位符。</p>
</td>
</tr>
<tr id="row3853mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3855mcpsimp"><a name="p3855mcpsimp"></a><a name="p3855mcpsimp"></a>-s YY/MM/DD</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.4.1.2 "><p id="p3857mcpsimp"><a name="p3857mcpsimp"></a><a name="p3857mcpsimp"></a>设置系统时间,用“/”分割的年月日。</p>
</td>
<td class="cellrowborder" valign="top" width="28.999999999999996%" headers="mcps1.2.4.1.3 "><p id="p3859mcpsimp"><a name="p3859mcpsimp"></a><a name="p3859mcpsimp"></a>&gt;= 1970/01/01</p>
</td>
</tr>
<tr id="row3860mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3862mcpsimp"><a name="p3862mcpsimp"></a><a name="p3862mcpsimp"></a>-s hh:mm:ss</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.4.1.2 "><p id="p3864mcpsimp"><a name="p3864mcpsimp"></a><a name="p3864mcpsimp"></a>设置系统时间,用“:”分割的时分秒。</p>
</td>
<td class="cellrowborder" valign="top" width="28.999999999999996%" headers="mcps1.2.4.1.3 "><p id="p3866mcpsimp"><a name="p3866mcpsimp"></a><a name="p3866mcpsimp"></a>N/A</p>
<td class="cellrowborder" valign="top" width="29%" headers="mcps1.2.4.1.3 "><p id="p3852mcpsimp"><a name="p3852mcpsimp"></a><a name="p3852mcpsimp"></a>--help中列出的占位符。</p>
</td>
</tr>
<tr id="row3867mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3869mcpsimp"><a name="p3869mcpsimp"></a><a name="p3869mcpsimp"></a>-r Filename</p>
<tr id="row3853mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3855mcpsimp"><a name="p3855mcpsimp"></a><a name="p3855mcpsimp"></a>-u</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.4.1.2 "><p id="p3871mcpsimp"><a name="p3871mcpsimp"></a><a name="p3871mcpsimp"></a>查询Filename文件的修改时间。</p>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.4.1.2 "><p id="p3857mcpsimp"><a name="p3857mcpsimp"></a><a name="p3857mcpsimp"></a>显示UTC,而不是当前时区</p>
</td>
<td class="cellrowborder" valign="top" width="28.999999999999996%" headers="mcps1.2.4.1.3 "><p id="p3873mcpsimp"><a name="p3873mcpsimp"></a><a name="p3873mcpsimp"></a>N/A</p>
<td class="cellrowborder" valign="top" width="29%" headers="mcps1.2.4.1.3 "><p id="p3859mcpsimp"><a name="p3859mcpsimp"></a><a name="p3859mcpsimp"></a>N/A</p>
</td>
</tr>
</tbody>
......@@ -78,17 +61,21 @@ date -r \[_Filename_\]
## 使用指南<a name="section116361036636"></a>
- date参数缺省时,默认显示当前系统日期和时间。
- --help、+Format、-s、-r不能混合使用。
- date参数缺省时,默认显示系统UTC日期和时间。
- --help、+Format、-u不能混合使用。
- 目前命令不支持设置时间和日期。
## 使用实例<a name="section021711411237"></a>
举例:
输入date +%Y--%m--%d。
输入 date +%Y--%m--%d
## 输出说明<a name="section17950184414312"></a>
**图 1** 按指定格式打印系统日期<a name="fig152576304517"></a>
![](figure/按指定格式打印系统日期.png "按指定格式打印系统日期")
**示例 1** 按指定格式打印系统日期
```shell
OHOS:/$ date +%Y--%m--%d
1970--01--01
```
\ No newline at end of file
# free<a name="ZH-CN_TOPIC_0000001133846472"></a>
- [命令功能](#section175151514841)
- [命令格式](#section8488721749)
- [参数说明](#section27272181949)
- [使用指南](#section148661259410)
- [使用实例](#section68081530242)
- [输出说明](#section171235517543)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section175151514841"></a>
## 命令功能<a name="section01"></a>
free命令可显示系统内存的使用情况,同时显示系统的text段、data段、rodata段、bss段大小
free命令可显示系统内存的使用情况。
## 命令格式<a name="section8488721749"></a>
## 命令格式<a name="section02"></a>
free \[_-k | -m_\]
free \[_-b | -k | -m | -g | -t_\]
## 参数说明<a name="section27272181949"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -35,6 +35,20 @@ free \[_-k | -m_\]
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p129mcpsimp"><a name="p129mcpsimp"></a><a name="p129mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row130mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p132mcpsimp"><a name="p132mcpsimp"></a><a name="p132mcpsimp"></a>--help/-h</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p134mcpsimp"><a name="p134mcpsimp"></a><a name="p134mcpsimp"></a>查看free命令支持的参数列表。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p136mcpsimp"><a name="p136mcpsimp"></a><a name="p136mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row130mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p132mcpsimp"><a name="p132mcpsimp"></a><a name="p132mcpsimp"></a>-b</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p134mcpsimp"><a name="p134mcpsimp"></a><a name="p134mcpsimp"></a>以Byte为单位显示。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p136mcpsimp"><a name="p136mcpsimp"></a><a name="p136mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row130mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p132mcpsimp"><a name="p132mcpsimp"></a><a name="p132mcpsimp"></a>-k</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p134mcpsimp"><a name="p134mcpsimp"></a><a name="p134mcpsimp"></a>以KiB为单位显示。</p>
......@@ -49,23 +63,54 @@ free \[_-k | -m_\]
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p143mcpsimp"><a name="p143mcpsimp"></a><a name="p143mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row137mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p139mcpsimp"><a name="p139mcpsimp"></a><a name="p139mcpsimp"></a>-g</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p141mcpsimp"><a name="p141mcpsimp"></a><a name="p141mcpsimp"></a>以GiB为单位显示。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p143mcpsimp"><a name="p143mcpsimp"></a><a name="p143mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row137mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p139mcpsimp"><a name="p139mcpsimp"></a><a name="p139mcpsimp"></a>-t</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p141mcpsimp"><a name="p141mcpsimp"></a><a name="p141mcpsimp"></a>以TiB为单位显示。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p143mcpsimp"><a name="p143mcpsimp"></a><a name="p143mcpsimp"></a>N/A</p>
</td>
</tr>
</tbody>
</table>
## 使用指南<a name="section148661259410"></a>
## 使用指南<a name="section04"></a>
无。
## 使用实例<a name="section68081530242"></a>
## 使用实例<a name="section05"></a>
举例:分别输入free、free -k、free -m.
举例:分别输入free、free -k、free -m
## 输出说明<a name="section171235517543"></a>
## 输出说明<a name="section06"></a>
**图 1** 以三种方式显示内存使用情况<a name="fig478715471421"></a>
![](figure/以三种方式显示内存使用情况.png "以三种方式显示内存使用情况")
**示例 1** 以三种方式显示内存使用情况
**表 2** 输出说明
```shell
OHOS:/$ free
total used free shared buffers
Mem: 2819652 2754468 65184 0 0
-/+ buffers/cache: 2754468 65184
Swap: 0 0 0
OHOS:/$ free -k
total used free shared buffers
Mem: 2753 2692 60 0 0
-/+ buffers/cache: 2692 60
Swap: 0 0 0
OHOS:/$ free -m
total used free shared buffers
Mem: 2 2 0 0 0
-/+ buffers/cache: 2 0
Swap: 0 0 0
```
**表 2** 输出元素说明
<a name="table633mcpsimp"></a>
<table><thead align="left"><tr id="row638mcpsimp"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p640mcpsimp"><a name="p640mcpsimp"></a><a name="p640mcpsimp"></a>输出</p>
......@@ -89,31 +134,15 @@ free \[_-k | -m_\]
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p657mcpsimp"><a name="p657mcpsimp"></a><a name="p657mcpsimp"></a>表示未被分配的内存大小。</p>
</td>
</tr>
<tr id="row658mcpsimp"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p660mcpsimp"><a name="p660mcpsimp"></a><a name="p660mcpsimp"></a>heap</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p662mcpsimp"><a name="p662mcpsimp"></a><a name="p662mcpsimp"></a>表示已分配堆大小。</p>
</td>
</tr>
<tr id="row10101624938"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p610724734"><a name="p610724734"></a><a name="p610724734"></a>text</p>
<tr id="row658mcpsimp"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p660mcpsimp"><a name="p660mcpsimp"></a><a name="p660mcpsimp"></a>shared</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1510024539"><a name="p1510024539"></a><a name="p1510024539"></a>表示代码段大小。</p>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p662mcpsimp"><a name="p662mcpsimp"></a><a name="p662mcpsimp"></a>表示共享内存大小。</p>
</td>
</tr>
<tr id="row207288271839"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p572872713317"><a name="p572872713317"></a><a name="p572872713317"></a>data</p>
<tr id="row10101624938"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p610724734"><a name="p610724734"></a><a name="p610724734"></a>buffers</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p272852716315"><a name="p272852716315"></a><a name="p272852716315"></a>表示数据段大小。</p>
</td>
</tr>
<tr id="row1774316321731"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p274343218317"><a name="p274343218317"></a><a name="p274343218317"></a>rodata</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1974319321133"><a name="p1974319321133"></a><a name="p1974319321133"></a>表示只读数据段大小。</p>
</td>
</tr>
<tr id="row121618371536"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p0161183720314"><a name="p0161183720314"></a><a name="p0161183720314"></a>bss</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p09295155511"><a name="p09295155511"></a><a name="p09295155511"></a>表示未初始化全局变量占用内存大小。</p>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1510024539"><a name="p1510024539"></a><a name="p1510024539"></a>表示缓冲区内存大小。</p>
</td>
</tr>
</tbody>
</table>
# help<a name="ZH-CN_TOPIC_0000001134006250"></a>
- [命令功能](#section991211345413)
- [命令格式](#section19103204016410)
- [参数说明](#section1533416233432)
- [使用指南](#section4156445417)
- [使用实例](#section12776124712417)
- [输出说明](#section092662412544)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section991211345413"></a>
## 命令功能<a name="section01"></a>
help命令用于显示当前操作系统内所有操作指令。
help命令用于显示当前操作系统内所有操作指令和部分toybox指令
## 命令格式<a name="section19103204016410"></a>
## 命令格式<a name="section02"></a>
help
## 参数说明<a name="section1533416233432"></a>
## 参数说明<a name="section03"></a>
无。
## 使用指南<a name="section4156445417"></a>
## 使用指南<a name="section04"></a>
help用于显示当前操作系统内所有操作指令。
## 使用实例<a name="section12776124712417"></a>
## 使用实例<a name="section05"></a>
举例:输入help
举例:输入help
## 输出说明<a name="section092662412544"></a>
## 输出说明<a name="section06"></a>
查看系统内所有操作指令。
**示例1** 查看系统内所有操作指令
```
OHOS # help
```shell
OHOS:/$ help
*******************shell commands:*************************
arp cat cd chgrp chmod chown cp cpup
date dhclient dmesg dns format free help hwi
ifconfig ipdebug kill log ls lsfd memcheck mkdir
mount netstat oom partinfo partition ping ping6 pwd
reset rm rmdir sem statfs su swtmr sync
systeminfo task telnet tftp touch umount uname watch
writeproc
arp cat cat_logmpp cd chgrp chmod chown cp
cpup date dhclient dmesg dns format free help
hi3881 hwi ifconfig ipdebug kill log ls lsfd
memcheck mkdir mount netstat oom panicreset partinfo partition
ping ping6 pmm pwd reset rm rmdir sem
shm stack statfs su swtmr sync systeminfo task
telnet touch umount uname v2p vmm watch writeproc
usage: help [command]
Show usage information for toybox commands.
Run "toybox" with no arguments for a list of available commands.
```
**内容声明:**
展示toybox指令请使用toybox。
**示例2** toybox指令集
```shell
OHOS:/$ toybox
chgrp chmod chown cp date du free help ifconfig kill ls mkdir mount
mv ping ps reboot rm rmdir top touch umount uname
```
# kill<a name="ZH-CN_TOPIC_0000001179965835"></a>
- [命令功能](#section366714216619)
- [命令格式](#section8833164614615)
- [参数说明](#section12809111019453)
- [使用指南](#section15935131220717)
- [使用实例](#section79281818476)
- [输出说明](#section12742311179)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section366714216619"></a>
## 命令功能<a name="section01"></a>
命令用于发送特定信号给指定进程。
## 命令格式<a name="section8833164614615"></a>
## 命令格式<a name="section02"></a>
kill \[_signo_ | _-signo_\] \[_pid_\]
kill \[-l \[_signo_\] | _-s signo_ | _-signo_\] _pid..._
## 参数说明<a name="section12809111019453"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -28,7 +28,28 @@ kill \[_signo_ | _-signo_\] \[_pid_\]
</th>
</tr>
</thead>
<tbody><tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>signo</p>
<tbody><tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>--help</p>
</td>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>查看kill命令支持的参数列表</p>
</td>
<td class="cellrowborder" valign="top" width="27.08%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
<tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>-l</p>
</td>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>列出信号名称和编号。</p>
</td>
<td class="cellrowborder" valign="top" width="27.08%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
<tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>-s</p>
</td>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>发送信号</p>
</td>
<td class="cellrowborder" valign="top" width="27.08%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
<tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>signo</p>
</td>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>信号ID。</p>
</td>
......@@ -48,35 +69,86 @@ kill \[_signo_ | _-signo_\] \[_pid_\]
>![](../public_sys-resources/icon-notice.gif) **须知:**
>signo有效范围为\[0,64\],建议取值范围为\[1,30\],其余为保留内容。
## 使用指南<a name="section15935131220717"></a>
## 使用指南<a name="section04"></a>
必须指定发送的信号编号及进程号。
进程编号取值范围根据系统配置变化,例如系统最大支持pid为256,则取值范围缩小为\[1-256\]
## 使用实例<a name="section79281818476"></a>
1. 查看当前进程列表,查看需要杀死的进程PID(7)。
## 使用实例<a name="section05"></a>
1. 查看当前进程列表,查看需要杀死的进程PID(42)。
```
OHOS:/$ ps
allCpu(%): 4.67 sys, 195.33 idle
PID PPID PGID UID Status VirtualMem ShareMem PhysicalMem CPUUSE10s PName
1 -1 1 0 Pending 0x33b000 0xbb000 0x4db02 0.0 init
2 -1 2 0 Pending 0xdabc08 0 0xdabc08 1.14 KProcess
3 1 3 7 Pending 0x72e000 0x1a3000 0x1d24c2 0.0 foundation
4 1 4 8 Pending 0x362000 0xbb000 0x5c6ff 0.0 bundle_daemon
5 1 5 1 Pending 0xdfa000 0x2e7000 0x1484f0 0.0 appspawn
6 1 6 0 Pending 0x688000 0x137000 0x11bca0 0.0 media_server
7 1 7 0 Pending 0x9d2000 0x103000 0xa1cdf 0.88 wms_server
8 1 8 2 Pending 0x1f5000 0x48000 0x47dc2 0.2 mksh
10 5 5 101 Pending 0x11ec000 0x2f9000 0x206047 0.93 com.huawei.launcher
12 1 12 0 Pending 0x4d4000 0x112000 0xe0882 0.0 deviceauth_service
13 1 13 0 Pending 0x34f000 0xbd000 0x51799 0.0 sensor_service
14 1 14 2 Pending 0x34e000 0xb3000 0x52184 0.0 ai_server
15 1 15 0 Pending 0x61f000 0x13b000 0x168071 0.45 softbus_server
42 8 42 2 Pending 0x1c1000 0x3a000 0x1106a 0.9 test_demo
43 8 43 2 Running 0x1d7000 0x3a000 0x1e577 0.0 toybox
```
2. 发送信号9(SIGKILL默认行为为立即终止进程)给42号进程**test\_demo**(用户态进程):**kill -s 9 42**(kill -9 42效果相同),并查看当前进程列表,42号进程已终止。
```
OHOS:/$ kill -s 9 42
OHOS:/$
[1] + Killed ./nfs/test_demo
OHOS:/$ ps
allCpu(%): 4.73 sys, 195.27 idle
PID PPID PGID UID Status VirtualMem ShareMem PhysicalMem CPUUSE10s PName
1 -1 1 0 Pending 0x33b000 0xbb000 0x4e01c 0.0 init
2 -1 2 0 Pending 0xda5fa4 0 0xda5fa4 1.14 KProcess
3 1 3 7 Pending 0x72e000 0x1a3000 0x1d29dc 0.0 foundation
4 1 4 8 Pending 0x362000 0xbb000 0x5cc19 0.0 bundle_daemon
5 1 5 1 Pending 0xdfa000 0x2e7000 0x148a0a 0.0 appspawn
6 1 6 0 Pending 0x688000 0x137000 0x11c1ba 0.0 media_server
7 1 7 0 Pending 0x9d2000 0x103000 0xa21f9 0.89 wms_server
8 1 8 2 Pending 0x1f5000 0x48000 0x482dc 0.2 mksh
10 5 5 101 Pending 0x11ec000 0x2f9000 0x206561 0.93 com.huawei.launcher
12 1 12 0 Pending 0x4d4000 0x112000 0xe0d9c 0.0 deviceauth_service
13 1 13 0 Pending 0x34f000 0xbd000 0x51cb3 0.0 sensor_service
14 1 14 2 Pending 0x34e000 0xb3000 0x5269e 0.0 ai_server
15 1 15 0 Pending 0x61f000 0x13b000 0x16858b 0.51 softbus_server
45 8 45 2 Running 0x1d7000 0x3a000 0x1e9f5 0.0 toybox
```
## 输出说明<a name="section06"></a>
**图 1** 查看进程PID<a name="fig6133125414256"></a>
![](figure/查看进程PID.png "查看进程PID")
2. 发送信号14(SIGALRM默认行为为进程终止)给7号进程**helloworld\_d**(用户态进程):**kill 14 7**(kill -14 7效果相同),并查看当前进程列表,7号进程已终止。
**图 2** 信号发送结果图<a name="fig2281711563"></a>
![](figure/信号发送结果图.png "信号发送结果图")
发送成功或失败输出结果如下。
## 输出说明<a name="section12742311179"></a>
**示例 1** 发送信号给指定进程
发送成功或失败输出结果如下。
```shell
OHOS:/$ kill -s 9 42
OHOS:/$
[1] + Killed ./nfs/test_demo
```
**图 3** 发送信号给指定进程<a name="fig11800272147"></a>
![](figure/发送信号给指定进程.png "发送信号给指定进程")
信号发送成功会显示的提示进程已被杀死。
信号发送会显示发送记录,未报错表示信号发送成功。
**示例 2** 信号发送失败
**图 4** 信号发送失败<a name="fig24081235151813"></a>
![](figure/信号发送失败.png "信号发送失败")
```shell
OHOS:/$ kill -100 31
kill: Unknown signal '(null)'
```
信号发送失败,上图所示原因为信号发送命令参数无效,请排查信号编号及进程编号是否无效。
信号发送失败,示例2所示原因为信号发送命令参数无效,请排查信号编号及进程编号是否有效。
# reboot<a name="ZH-CN_TOPIC_0000001133846477"></a>
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section01"></a>
reboot命令用于重启设备。
## 命令格式<a name="section02"></a>
reboot
## 参数说明<a name="section03"></a>
无。
## 使用指南<a name="section04"></a>
reboot命令输入后,设备会立刻重启。
## 使用实例<a name="section05"></a>
reboot
## 输出说明<a name="section06"></a>
无。
......@@ -21,7 +21,7 @@ reset
## 使用指南<a name="section15935131220717"></a>
reset命令输入后,设备会立刻重启。
reset命令输入后,设备会立刻重启。
## 使用实例<a name="section79281818476"></a>
......
# top<a name="ZH-CN_TOPIC_0000001179845936"></a>
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section01"></a>
top命令用于查询进程及线程信息。
## 命令格式<a name="section02"></a>
top \[_-a_\]
## 参数说明<a name="section03"></a>
**表 1** 参数说明
<a name="table1557mcpsimp"></a>
<table><thead align="left"><tr id="row1563mcpsimp"><th class="cellrowborder" valign="top" width="21%" id="mcps1.2.4.1.1"><p id="p1565mcpsimp"><a name="p1565mcpsimp"></a><a name="p1565mcpsimp"></a>参数</p>
</th>
<th class="cellrowborder" valign="top" width="52%" id="mcps1.2.4.1.2"><p id="p1567mcpsimp"><a name="p1567mcpsimp"></a><a name="p1567mcpsimp"></a>参数说明</p>
</th>
<th class="cellrowborder" valign="top" width="27%" id="mcps1.2.4.1.3"><p id="p1569mcpsimp"><a name="p1569mcpsimp"></a><a name="p1569mcpsimp"></a>取值范围</p>
</th>
</tr>
</thead>
<tbody><tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>--help</p>
</td>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>查看top命令支持的参数列表。</p>
</td>
<td class="cellrowborder" valign="top" width="27.08%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
<tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>-a</p>
</td>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>显示更详细的信息。</p>
</td>
<td class="cellrowborder" valign="top" width="27.08%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
</tbody>
</table>
## 使用指南<a name="section04"></a>
- 参数缺省时默认打印部分任务信息。
## 使用实例<a name="section05"></a>
举例:输入top
## 输出说明<a name="section06"></a>
**示例 1** top 命令显示详情
```shell
OHOS:/$ top
allCpu(%): 4.68 sys, 195.32 idle
PID PPID PGID UID Status VirtualMem ShareMem PhysicalMem CPUUSE10s PName
1 -1 1 0 Pending 0x33b000 0xbb000 0x4e01c 0.0 init
2 -1 2 0 Pending 0xd838c0 0 0xd838c0 1.16 KProcess
3 1 3 7 Pending 0x72e000 0x1a3000 0x1d29dc 0.0 foundation
4 1 4 8 Pending 0x362000 0xbb000 0x5cc19 0.0 bundle_daemon
5 1 5 1 Pending 0xdfa000 0x2e7000 0x148a0a 0.0 appspawn
6 1 6 0 Pending 0x688000 0x137000 0x11c1ba 0.0 media_server
7 1 7 0 Pending 0x9d2000 0x103000 0xa21f9 0.87 wms_server
8 1 8 2 Pending 0x1f5000 0x48000 0x462dc 0.0 mksh
9 5 5 101 Pending 0x11ea000 0x2f9000 0x204561 0.94 com.huawei.launcher
11 1 11 0 Pending 0x4d4000 0x112000 0xe0d9c 0.0 deviceauth_service
12 1 12 0 Pending 0x34f000 0xbd000 0x51cb3 0.0 sensor_service
13 1 13 2 Pending 0x34e000 0xb3000 0x5269e 0.0 ai_server
14 1 14 0 Pending 0x61f000 0x13b000 0x16858b 0.45 softbus_server
43 8 43 2 Running 0x1d7000 0x3a000 0x1e9f5 0.0 toybox
TID PID Affi CPU Status StackSize WaterLine CPUUSE10s MEMUSE TaskName
23 1 0x3 -1 Pending 0x3000 0xcf4 0.0 0 init
1 2 0x1 -1 Pending 0x4000 0x2c4 0.33 0 Swt_Task
2 2 0x3 -1 Pending 0x4000 0x204 0.0 0 system_wq
3 2 0x2 -1 Pending 0x4000 0x514 0.75 0 Swt_Task
4 2 0x3 -1 Pending 0x1000 0x3ac 0.0 0 ResourcesTask
7 2 0x3 -1 Pending 0x4e20 0xa5c 0.0 0 PlatformWorkerThread
8 2 0x3 -1 Pending 0x4e20 0xa6c 0.0 0 PlatformWorkerThread
9 2 0x3 -1 Pending 0x4e20 0xbf4 0.0 0 PlatformWorkerThread
10 2 0x3 -1 Pending 0x3000 0x4dc 0.0 0 bcache_async_task
11 2 0x3 -1 PendTime 0x4000 0x3e4 0.5 0 hi_vdec_thread
12 2 0x3 -1 Pending 0x2710 0x224 0.0 0 LiteOS usb pnp notify handle kt
13 2 0x3 -1 Pending 0x3000 0x37c 0.0 0 bcache_async_task
14 2 0x3 -1 Pending 0x4000 0x204 0.0 0 vibrator_queue
15 2 0x3 -1 Pending 0x20000 0x35c 0.0 0 eth_irq_Task
16 2 0x3 -1 PendTime 0x2000 0x354 0.0 0 MessageDispatcher
18 2 0x3 -1 Pending 0x2710 0x200 0.0 0 GPIO_IRQ_TSK_0_4
19 2 0x3 -1 Pending 0x4000 0x204 0.0 0 dispWQ
20 2 0x3 -1 Pending 0x4000 0x204 0.0 0 hdf_sensor_test_work_queue
21 2 0x3 -1 PendTime 0x6000 0x40c 0.2 0 tcpip_thread
22 2 0x3 -1 Pending 0x4000 0x36c 0.0 0 SendToSer
61 2 0x3 -1 Pending 0x4000 0x244 0.0 0 USB_GIANT_Task
63 2 0x3 -1 Pending 0x4000 0x244 0.0 0 USB_NGIAN_ISOC_Task
64 2 0x3 -1 Pending 0x4000 0x244 0.0 0 USB_NGIAN_BULK_TasK
```
**表2** 输出元素说明
<table><thead align="left"><tr id="row814mcpsimp"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p816mcpsimp"><a name="p816mcpsimp"></a><a name="p816mcpsimp"></a>输出</p>
</th>
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p818mcpsimp"><a name="p818mcpsimp"></a><a name="p818mcpsimp"></a>说明</p>
</th>
</tr>
</thead>
<tbody><tr id="row20360171311398"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p123611139397"><a name="p123611139397"></a><a name="p123611139397"></a>PID</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p3361171333920"><a name="p3361171333920"></a><a name="p3361171333920"></a>进程ID。</p>
</td>
</tr>
<tr id="row262535153913"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p862625163918"><a name="p862625163918"></a><a name="p862625163918"></a>PPID</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1062611511398"><a name="p1062611511398"></a><a name="p1062611511398"></a>父进程ID。</p>
</td>
</tr>
<tr id="row9683953153916"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p76831753103915"><a name="p76831753103915"></a><a name="p76831753103915"></a>PGID</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p2068355383916"><a name="p2068355383916"></a><a name="p2068355383916"></a>进程组ID。</p>
</td>
</tr>
<tr id="row85721136402"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p8572151313402"><a name="p8572151313402"></a><a name="p8572151313402"></a>UID</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p55721813164013"><a name="p55721813164013"></a><a name="p55721813164013"></a>用户ID。</p>
</td>
</tr>
<tr id="row19180126151415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p836mcpsimp"><a name="p836mcpsimp"></a><a name="p836mcpsimp"></a>Status</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p838mcpsimp"><a name="p838mcpsimp"></a><a name="p838mcpsimp"></a>任务当前的状态。</p>
</td>
</tr>
<tr id="row511517331702"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p2116833506"><a name="p2116833506"></a><a name="p2116833506"></a>CPUUSE10s</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p2011611331604"><a name="p2011611331604"></a><a name="p2011611331604"></a>10秒内CPU使用率。</p>
</td>
</tr>
<tr id="row136191839311"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p66199397110"><a name="p66199397110"></a><a name="p66199397110"></a>PName</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p11619153916110"><a name="p11619153916110"></a><a name="p11619153916110"></a>进程名。</p>
</td>
</tr>
<tr id="row824mcpsimp"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p826mcpsimp"><a name="p826mcpsimp"></a><a name="p826mcpsimp"></a>TID</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p828mcpsimp"><a name="p828mcpsimp"></a><a name="p828mcpsimp"></a>任务ID。</p>
</td>
</tr>
<tr id="row839mcpsimp"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p841mcpsimp"><a name="p841mcpsimp"></a><a name="p841mcpsimp"></a>StackSize</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p843mcpsimp"><a name="p843mcpsimp"></a><a name="p843mcpsimp"></a>任务堆栈的大小。</p>
</td>
</tr>
<tr id="row844mcpsimp"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p846mcpsimp"><a name="p846mcpsimp"></a><a name="p846mcpsimp"></a>WaterLine</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p848mcpsimp"><a name="p848mcpsimp"></a><a name="p848mcpsimp"></a>栈使用的峰值。</p>
</td>
</tr>
<tr id="row10188146131813"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p218912671818"><a name="p218912671818"></a><a name="p218912671818"></a>MEMUSE</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1518926151810"><a name="p1518926151810"></a><a name="p1518926151810"></a>内存使用量。</p>
</td>
</tr>
<tr id="row45465584313"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p821mcpsimp"><a name="p821mcpsimp"></a><a name="p821mcpsimp"></a>TaskName</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p823mcpsimp"><a name="p823mcpsimp"></a><a name="p823mcpsimp"></a>任务名。</p>
</td>
</tr>
</tbody>
</table>
# uname<a name="ZH-CN_TOPIC_0000001179965843"></a>
- [命令功能](#section107697383115)
- [命令格式](#section162824341116)
- [使用指南](#section2652124861114)
- [使用实例](#section0107995132)
- [输出说明](#section1215113245511)
- [命令功能](#section01)
- [命令格式](#section02)
- [使用指南](#section03)
- [使用实例](#section04)
- [输出说明](#section05)
## 命令功能<a name="section107697383115"></a>
## 命令功能<a name="section01"></a>
uname命令用于显示当前操作系统的名称,版本创建时间,系统名称,版本信息等。
## 命令格式<a name="section162824341116"></a>
## 命令格式<a name="section02"></a>
uname \[_-a | -s | -t | -v | --help_\]
uname \[_-a | -s | -r | -m | -n | -v --help_\]
**表 1** 参数说明
<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>参数</p>
<table><thead align="left"><tr id="row914mcpsimp"><th class="cellrowborder" valign="top" width="34%" id="mcps1.2.3.1.1"><p id="p916mcpsimp"><a name="p916mcpsimp"></a><a name="p916mcpsimp"></a>参数</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>参数说明</p>
<th class="cellrowborder" valign="top" width="66%" id="mcps1.2.3.1.2"><p id="p918mcpsimp"><a name="p918mcpsimp"></a><a name="p918mcpsimp"></a>参数说明</p>
</th>
</tr>
</thead>
<tbody><tr id="row119816412718"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p1384693214813"><a name="p1384693214813"></a><a name="p1384693214813"></a>无参数</p>
<tbody><tr id="row944mcpsimp"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.2.3.1.1 "><p id="p946mcpsimp"><a name="p946mcpsimp"></a><a name="p946mcpsimp"></a>--help</p>
</td>
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p18199114113719"><a name="p18199114113719"></a><a name="p18199114113719"></a>默认显示操作系统名称</p>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.2.3.1.2 "><p id="p948mcpsimp"><a name="p948mcpsimp"></a><a name="p948mcpsimp"></a>显示uname指令格式提示</p>
</td>
</tr>
<tr id="row919mcpsimp"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p921mcpsimp"><a name="p921mcpsimp"></a><a name="p921mcpsimp"></a>-a</p>
<tr id="row119816412718"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.2.3.1.1 "><p id="p1384693214813"><a name="p1384693214813"></a><a name="p1384693214813"></a>无参数</p>
</td>
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p923mcpsimp"><a name="p923mcpsimp"></a><a name="p923mcpsimp"></a>显示全部信息</p>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.2.3.1.2 "><p id="p18199114113719"><a name="p18199114113719"></a><a name="p18199114113719"></a>默认显示操作系统名称</p>
</td>
</tr>
<tr id="row924mcpsimp"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p926mcpsimp"><a name="p926mcpsimp"></a><a name="p926mcpsimp"></a>-t</p>
<tr id="row919mcpsimp"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.2.3.1.1 "><p id="p921mcpsimp"><a name="p921mcpsimp"></a><a name="p921mcpsimp"></a>-a</p>
</td>
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p928mcpsimp"><a name="p928mcpsimp"></a><a name="p928mcpsimp"></a>显示版本创建的时间</p>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.2.3.1.2 "><p id="p923mcpsimp"><a name="p923mcpsimp"></a><a name="p923mcpsimp"></a>显示全部信息</p>
</td>
</tr>
<tr id="row929mcpsimp"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p931mcpsimp"><a name="p931mcpsimp"></a><a name="p931mcpsimp"></a>-s</p>
<tr id="row929mcpsimp"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.2.3.1.1 "><p id="p931mcpsimp"><a name="p931mcpsimp"></a><a name="p931mcpsimp"></a>-s</p>
</td>
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p933mcpsimp"><a name="p933mcpsimp"></a><a name="p933mcpsimp"></a>显示操作系统名称。</p>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.2.3.1.2 "><p id="p933mcpsimp"><a name="p933mcpsimp"></a><a name="p933mcpsimp"></a>显示操作系统名称。</p>
</td>
</tr>
<tr id="row934mcpsimp"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p936mcpsimp"><a name="p936mcpsimp"></a><a name="p936mcpsimp"></a>-v</p>
<tr id="row929mcpsimp"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.2.3.1.1 "><p id="p931mcpsimp"><a name="p931mcpsimp"></a><a name="p931mcpsimp"></a>-r</p>
</td>
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p938mcpsimp"><a name="p938mcpsimp"></a><a name="p938mcpsimp"></a>显示版本信息</p>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.2.3.1.2 "><p id="p933mcpsimp"><a name="p933mcpsimp"></a><a name="p933mcpsimp"></a>显示内核发行版本</p>
</td>
</tr>
<tr id="row944mcpsimp"><td class="cellrowborder" valign="top" width="33.989999999999995%" headers="mcps1.2.3.1.1 "><p id="p946mcpsimp"><a name="p946mcpsimp"></a><a name="p946mcpsimp"></a>--help</p>
<tr id="row934mcpsimp"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.2.3.1.1 "><p id="p936mcpsimp"><a name="p936mcpsimp"></a><a name="p936mcpsimp"></a>-m</p>
</td>
<td class="cellrowborder" valign="top" width="66.01%" headers="mcps1.2.3.1.2 "><p id="p948mcpsimp"><a name="p948mcpsimp"></a><a name="p948mcpsimp"></a>显示uname指令格式提示。</p>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.2.3.1.2 "><p id="p938mcpsimp"><a name="p938mcpsimp"></a><a name="p938mcpsimp"></a>显示系统架构名称。</p>
</td>
</tr>
<tr id="row924mcpsimp"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.2.3.1.1 "><p id="p926mcpsimp"><a name="p926mcpsimp"></a><a name="p926mcpsimp"></a>-n</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.2.3.1.2 "><p id="p928mcpsimp"><a name="p928mcpsimp"></a><a name="p928mcpsimp"></a>显示主机的网络域名称。</p>
</td>
</tr>
<tr id="row934mcpsimp"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.2.3.1.1 "><p id="p936mcpsimp"><a name="p936mcpsimp"></a><a name="p936mcpsimp"></a>-v</p>
</td>
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.2.3.1.2 "><p id="p938mcpsimp"><a name="p938mcpsimp"></a><a name="p938mcpsimp"></a>显示版本信息。</p>
</td>
</tr>
</tbody>
</table>
## 使用指南<a name="section2652124861114"></a>
## 使用指南<a name="section03"></a>
uname用于显示当前操作系统名称。语法uname -a | -s | -r | -m | -n | -v 描述uname 命令将正在使用的操作系统名写到标准输出中。
uname用于显示当前操作系统名称。语法uname -a | -t| -s| -v 描述uname 命令将正在使用的操作系统名写到标准输出中,这几个参数不能混合使用。
## 使用实例<a name="section04"></a>
## 使用实例<a name="section0107995132"></a>
举例:输入uname -a 、uname -ms
举例:输入uname -a
## 输出说明<a name="section05"></a>
## 输出说明<a name="section1215113245511"></a>
**示例 1** 查看系统信息
查看系统信息
```shell
OHOS:/$ uname -a
Huawei LiteOS hisilicon 2.0.0.37 Huawei LiteOS 2.0.0.37 Oct 21 2021 17:39:32 Cortex-A7
OHOS:/$
```
![](figure/zh-cn_image_0000001179967909.png)
**示例 2** 只查看操作系统名称和系统架构名称
```shell
OHOS:/$ uname -ms
Huawei LiteOS Cortex-A7
OHOS:/$
```
......@@ -6,6 +6,8 @@
- **[dmesg](kernel-small-debug-shell-cmd-dmesg.md)**
- **[du](kernel-small-debug-shell-file-du.md)**
- **[exec](kernel-small-debug-shell-cmd-exec.md)**
- **[free](kernel-small-debug-shell-cmd-free.md)**
......@@ -24,6 +26,8 @@
- **[pmm](kernel-small-debug-shell-cmd-pmm.md)**
- **[reboot](kernel-small-debug-shell-cmd-reboot.md)**
- **[reset](kernel-small-debug-shell-cmd-reset.md)**
- **[sem](kernel-small-debug-shell-cmd-sem.md)**
......@@ -38,10 +42,10 @@
- **[task](kernel-small-debug-shell-cmd-task.md)**
- **[top](kernel-small-debug-shell-cmd-top.md)**
- **[uname](kernel-small-debug-shell-cmd-uname.md)**
- **[vmm](kernel-small-debug-shell-cmd-vmm.md)**
- **[watch](kernel-small-debug-shell-cmd-watch.md)**
# chgrp<a name="ZH-CN_TOPIC_0000001134006260"></a>
- [命令功能](#section6103119161418)
- [命令格式](#section186958132141)
- [参数说明](#section81796174141)
- [使用指南](#section14330152417140)
- [使用实例](#section951823119149)
- [输出说明](#section14271133125715)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section6103119161418"></a>
## 命令功能<a name="section01"></a>
chgrp用于修改文件的群组。
## 命令格式<a name="section186958132141"></a>
## 命令格式<a name="section02"></a>
chgrp \[_group_\] \[_pathname_\]
## 参数说明<a name="section81796174141"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
<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>参数</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>参数说明</p>
......@@ -45,16 +46,24 @@ chgrp \[_group_\] \[_pathname_\]
</tbody>
</table>
## 使用指南<a name="section14330152417140"></a>
## 使用指南<a name="section04"></a>
在需要修改的文件名前加上文件群组值就可以修改该文件的所属组。
- 在需要修改的文件名前加上文件群组值就可以修改该文件的所属组。
- fatfs文件系统不支持修改用户组id。
## 使用实例<a name="section951823119149"></a>
## 使用实例<a name="section05"></a>
举例:chgrp 100 hello-harmony.txt
举例:chgrp 100 testfile
## 输出说明<a name="section14271133125715"></a>
## 输出说明<a name="section06"></a>
**图 1** 修改 hello-harmony.txt 文件的群组为100<a name="fig17908710194919"></a>
![](figure/修改-hello-harmony-txt-文件的群组为100.png "修改-hello-harmony-txt-文件的群组为100")
**示例 1** 修改 dev/目录下testfile 文件的群组为100
```shell
OHOS:/dev$ ll testfile
-rw-r--r-- 0 0 0 0 1970-01-01 00:00 testfile
OHOS:/dev$ chgrp 100 testfile
OHOS:/dev$ ll testfile
-rw-r--r-- 0 0 100 0 1970-01-01 00:00 testfile
OHOS:/dev$
```
# chmod<a name="ZH-CN_TOPIC_0000001179845927"></a>
- [命令功能](#section13992936121418)
- [命令格式](#section63342439147)
- [参数说明](#section894414671411)
- [使用指南](#section182415221419)
- [使用实例](#section8518195718147)
- [输出说明](#section127391818158)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section13992936121418"></a>
## 命令功能<a name="section01"></a>
chmod用于修改文件操作权限。
## 命令格式<a name="section63342439147"></a>
## 命令格式<a name="section02"></a>
chmod \[_mode_\] \[_pathname_\]
chmod \[_mode_\] \[_filename_\]
## 参数说明<a name="section894414671411"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -35,7 +35,7 @@ chmod \[_mode_\] \[_pathname_\]
<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>
</td>
</tr>
<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>
<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>filename</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p4218826194210"><a name="p4218826194210"></a><a name="p4218826194210"></a>文件路径。</p>
</td>
......@@ -45,16 +45,25 @@ chmod \[_mode_\] \[_pathname_\]
</tbody>
</table>
## 使用指南<a name="section182415221419"></a>
## 使用指南<a name="section04"></a>
在需要修改的文件名前加上文件权限值就可以修改该文件的权限值。
- 在需要修改的文件名前加上文件权限值就可以修改该文件的权限值。
- fatfs文件系统所有创建的文件和挂载节点的权限属性保持一致,目前节点的权限只有用户读写权限,group和others权限不生效;且只允许修改用户读写权限,读写权限只有rw和ro两种。其他文件系统无限制。
## 使用实例<a name="section8518195718147"></a>
## 使用实例<a name="section05"></a>
举例:chmod 666 hello-harmony.txt
举例:chmod 644 hello-harmony.txt ; chmod 777 hello-harmony.txt
## 输出说明<a name="section127391818158"></a>
## 输出说明<a name="section06"></a>
**图 1** 修改 hello-harmony.txt 文件的权限为666<a name="fig501223144912"></a>
![](figure/修改-hello-harmony-txt-文件的权限为666.png "修改-hello-harmony-txt-文件的权限为666")
**示例 1** 修改/dev目录下 hello-harmony.txt 文件的权限
```shell
OHOS:/dev$ chmod 644 hello-harmony.txt
OHOS:/dev$ ll hello-harmony.txt
-rw-r--r-- 0 0 0 0 1970-01-01 00:00 hello-harmony.txt
OHOS:/dev$ chmod 777 hello-harmony.txt
OHOS:/dev$ ll hello-harmony.txt
-rwxrwxrwx 0 0 0 0 1970-01-01 00:00 hello-harmony.txt
```
# chown<a name="ZH-CN_TOPIC_0000001179965847"></a>
- [命令功能](#section247414691513)
- [命令格式](#section14773151018159)
- [参数说明](#section598731391517)
- [使用指南](#section16524152071510)
- [使用实例](#section17901152561510)
- [输出说明](#section15513163115816)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section247414691513"></a>
## 命令功能<a name="section01"></a>
chmod用于将指定文件的拥有者改为指定的用户或组
chown用于修改指定文件的拥有者
## 命令格式<a name="section14773151018159"></a>
## 命令格式<a name="section02"></a>
chown \[_owner_\] \[_group_\] \[_pathname_\]
chown \[_owner_\] \[_pathname_\]
## 参数说明<a name="section598731391517"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -35,14 +35,6 @@ chown \[_owner_\] \[_group_\] \[_pathname_\]
<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>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1066mcpsimp"><a name="p1066mcpsimp"></a><a name="p1066mcpsimp"></a>文件群组。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p81831811183618"><a name="p81831811183618"></a><a name="p81831811183618"></a>1、为空。</p>
<p id="p1068mcpsimp"><a name="p1068mcpsimp"></a><a name="p1068mcpsimp"></a>2、[0,0xFFFFFFFF]</p>
</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>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p4218826194210"><a name="p4218826194210"></a><a name="p4218826194210"></a>文件路径。</p>
......@@ -53,18 +45,23 @@ chown \[_owner_\] \[_group_\] \[_pathname_\]
</tbody>
</table>
## 使用指南<a name="section16524152071510"></a>
## 使用指南<a name="section04"></a>
- 在需要修改的文件名前加上文件拥有者和文件群组就可以分别修改该文件的拥有者和群组。
- 当owner或group值为-1时则表示对应的owner或group不修改。
- group参数可以为空。
修改文件的所有者,目前fatfs不支持修改。
## 使用实例<a name="section17901152561510"></a>
## 使用实例<a name="section05"></a>
举例:chown 100 200 hello-harmony.txt
举例:chown 100 testfile
## 输出说明<a name="section15513163115816"></a>
## 输出说明<a name="section06"></a>
**图 1** 修改 hello-harmony.txt 文件的uid为100,gid为200<a name="fig518593394920"></a>
![](figure/修改-hello-harmony-txt-文件的uid为100-gid为200.png "修改-hello-harmony-txt-文件的uid为100-gid为200")
**示例 1** 修改 /dev下的testfile 文件的uid为100
```shell
OHOS:/dev$ touch testfile
OHOS:/dev$ ll testfile
-rw-r--r-- 0 0 100 0 1970-01-01 00:00 testfile
OHOS:/dev$ chown 100 testfile
OHOS:/dev$ ll testfile
-rw-r--r-- 0 100 100 0 1970-01-01 00:00 testfile
```
# cp<a name="ZH-CN_TOPIC_0000001133846484"></a>
- [命令功能](#section6841203041513)
- [命令格式](#section24286359150)
- [参数说明](#section558617385152)
- [使用指南](#section16128156162)
- [使用实例](#section19354171211618)
- [输出说明](#section16754183195914)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section6841203041513"></a>
## 命令功能<a name="section01"></a>
拷贝文件,创建一份副本。
## 命令格式<a name="section24286359150"></a>
## 命令格式<a name="section02"></a>
cp --help
cp \[_SOURCEFILE_\] \[_DESTFILE_\]
## 参数说明<a name="section558617385152"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
<a name="table1130mcpsimp"></a>
<table><thead align="left"><tr id="row1136mcpsimp"><th class="cellrowborder" valign="top" width="21%" id="mcps1.2.4.1.1"><p id="p1138mcpsimp"><a name="p1138mcpsimp"></a><a name="p1138mcpsimp"></a>参数</p>
</th>
<th class="cellrowborder" valign="top" width="52%" id="mcps1.2.4.1.2"><p id="p1140mcpsimp"><a name="p1140mcpsimp"></a><a name="p1140mcpsimp"></a>参数说明</p>
<th class="cellrowborder" valign="top" width="27%" id="mcps1.2.4.1.2"><p id="p1140mcpsimp"><a name="p1140mcpsimp"></a><a name="p1140mcpsimp"></a>参数说明</p>
</th>
<th class="cellrowborder" valign="top" width="27%" id="mcps1.2.4.1.3"><p id="p1142mcpsimp"><a name="p1142mcpsimp"></a><a name="p1142mcpsimp"></a>取值范围</p>
<th class="cellrowborder" valign="top" width="52%" id="mcps1.2.4.1.3"><p id="p1142mcpsimp"><a name="p1142mcpsimp"></a><a name="p1142mcpsimp"></a>取值范围</p>
</th>
</tr>
</thead>
<tbody><tr id="row1143mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1145mcpsimp"><a name="p1145mcpsimp"></a><a name="p1145mcpsimp"></a>SOURCEFILE</p>
<tbody><tr id="row3838mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3840mcpsimp"><a name="p3840mcpsimp"></a><a name="p3840mcpsimp"></a>--help</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.2 "><p id="p3842mcpsimp"><a name="p3842mcpsimp"></a><a name="p3842mcpsimp"></a>使用帮助。</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.3 "><p id="p3844mcpsimp"><a name="p3844mcpsimp"></a><a name="p3844mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1143mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1145mcpsimp"><a name="p1145mcpsimp"></a><a name="p1145mcpsimp"></a>SOURCEFILE</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1147mcpsimp"><a name="p1147mcpsimp"></a><a name="p1147mcpsimp"></a>源文件路径。</p>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.2 "><p id="p1147mcpsimp"><a name="p1147mcpsimp"></a><a name="p1147mcpsimp"></a>源文件路径。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1149mcpsimp"><a name="p1149mcpsimp"></a><a name="p1149mcpsimp"></a>目前只支持文件,不支持目录</p>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.3 "><p id="p1149mcpsimp"><a name="p1149mcpsimp"></a><a name="p1149mcpsimp"></a>目前只支持文件,不支持目录;支持多文件同时拷贝</p>
</td>
</tr>
<tr id="row1150mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1152mcpsimp"><a name="p1152mcpsimp"></a><a name="p1152mcpsimp"></a>DESTFILE</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1154mcpsimp"><a name="p1154mcpsimp"></a><a name="p1154mcpsimp"></a>目的文件路径。</p>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.2 "><p id="p1154mcpsimp"><a name="p1154mcpsimp"></a><a name="p1154mcpsimp"></a>目的文件路径。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1156mcpsimp"><a name="p1156mcpsimp"></a><a name="p1156mcpsimp"></a>支持目录以及文件。</p>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.3 "><p id="p1156mcpsimp"><a name="p1156mcpsimp"></a><a name="p1156mcpsimp"></a>支持目录以及文件。</p>
</td>
</tr>
</tbody>
</table>
## 使用指南<a name="section16128156162"></a>
## 使用指南<a name="section04"></a>
- 同一路径下,源文件与目的文件不能重名。
- 源文件必须存在,且不为目录。
- 源文件路径支持“\*”和“?”通配符,“\*”代表任意多个字符,“?”代表任意单个字符。目的路径不支持通配符。当源路径可匹配多个文件时,目的路径必须为目录。
- 目的路径为目录时,该目录必须存在。此时目的文件以源文件命名。
- 目的路径为文件时,所在目录必须存在。此时拷贝文件的同时为副本重命名。
- 目前不支持多文件拷贝。参数大于2个时,只对前2个参数进行操作。
- 目的文件不存在时创建新文件,已存在则覆盖。
拷贝系统重要资源时,会对系统造成死机等重大未知影响,如用于拷贝/dev/uartdev-0 文件时,会产生系统卡死现象。
> ![](../public_sys-resources/icon-notice.gif) **须知:**
>
> 拷贝系统重要资源时,会对系统造成死机等重大未知影响,如用于拷贝/dev/uartdev-1 文件时,会产生系统卡死现象。
## 使用实例<a name="section19354171211618"></a>
## 使用实例<a name="section05"></a>
举例:cp hello-harmony.txt ./tmp/
举例:cp hello-OHOS.txt hello-harmony.txt ./tmp/
## 输出说明<a name="section16754183195914"></a>
## 输出说明<a name="section06"></a>
**图 1** 显示结果如下<a name="fig184025115493"></a>
![](figure/显示结果如下-24.png "显示结果如下-24")
**示例 1** 显示结果如下
```shell
OHOS:/$ ls
bin hello-OHOS.txt proc system vendor
dev hello-harmony.txt sdcard userdata
etc lib storage usr
OHOS:/$ mkdir tmp
OHOS:/$ cp hello-OHOS.txt hello-harmony.txt tmp/
OHOS:/$ ll tmp
total 0
-rwxrwxrwx 1 0 0 0 1979-12-31 00:00 hello-OHOS.txt*
-rwxrwxrwx 1 0 0 0 1979-12-31 00:00 hello-harmony.txt*
```
# du<a name="ZH-CN_TOPIC_0000001133846678"></a>
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section01"></a>
du显示指定的文件所占用的磁盘空间。
## 命令格式<a name="section02"></a>
du \[_-kKmh_\] \[_file..._\]
## 参数说明<a name="section03"></a>
**表 1** 参数说明
<a name="table1087mcpsimp"></a>
<table><thead align="left"><tr id="row1093mcpsimp"><th class="cellrowborder" valign="top" width="21%" id="mcps1.2.4.1.1"><p id="p1095mcpsimp"><a name="p1095mcpsimp"></a><a name="p1095mcpsimp"></a>参数</p>
</th>
<th class="cellrowborder" valign="top" width="52%" id="mcps1.2.4.1.2"><p id="p1097mcpsimp"><a name="p1097mcpsimp"></a><a name="p1097mcpsimp"></a>参数说明</p>
</th>
<th class="cellrowborder" valign="top" width="27%" id="mcps1.2.4.1.3"><p id="p1099mcpsimp"><a name="p1099mcpsimp"></a><a name="p1099mcpsimp"></a>取值范围</p>
</th>
</tr>
</thead>
<tbody><tr id="row1100mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1102mcpsimp"><a name="p1102mcpsimp"></a><a name="p1102mcpsimp"></a>--help</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1104mcpsimp"><a name="p1104mcpsimp"></a><a name="p1104mcpsimp"></a>查看du命令支持的参数列表。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1106mcpsimp"><a name="p1106mcpsimp"></a><a name="p1106mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1100mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1102mcpsimp"><a name="p1102mcpsimp"></a><a name="p1102mcpsimp"></a>-k</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1104mcpsimp"><a name="p1104mcpsimp"></a><a name="p1104mcpsimp"></a>显示占用的块,每块1024bytes(默认)。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1106mcpsimp"><a name="p1106mcpsimp"></a><a name="p1106mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1100mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1102mcpsimp"><a name="p1102mcpsimp"></a><a name="p1102mcpsimp"></a>-K</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1104mcpsimp"><a name="p1104mcpsimp"></a><a name="p1104mcpsimp"></a>显示占用的块,每块512bytes(posix)。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1106mcpsimp"><a name="p1106mcpsimp"></a><a name="p1106mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1100mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1102mcpsimp"><a name="p1102mcpsimp"></a><a name="p1102mcpsimp"></a>-m</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1104mcpsimp"><a name="p1104mcpsimp"></a><a name="p1104mcpsimp"></a>兆字节为单位。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1106mcpsimp"><a name="p1106mcpsimp"></a><a name="p1106mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1100mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1102mcpsimp"><a name="p1102mcpsimp"></a><a name="p1102mcpsimp"></a>-h</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1104mcpsimp"><a name="p1104mcpsimp"></a><a name="p1104mcpsimp"></a>以K,M,G为单位,提高信息的可读性(例如,1K 243M 2G)。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1106mcpsimp"><a name="p1106mcpsimp"></a><a name="p1106mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1100mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1102mcpsimp"><a name="p1102mcpsimp"></a><a name="p1102mcpsimp"></a>file</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1104mcpsimp"><a name="p1104mcpsimp"></a><a name="p1104mcpsimp"></a>指定的需要统计的文件。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1106mcpsimp"><a name="p1106mcpsimp"></a><a name="p1106mcpsimp"></a>N/A</p>
</td>
</tr>
</tbody>
</table>
## 使用指南<a name="section04"></a>
- 不支持统计目录的大小,只支持统计文件的大小。
- file的内容既为文件名,不能包含其所在的目录。
## 使用实例<a name="section05"></a>
举例:du -h testfile
## 输出说明<a name="section06"></a>
**示例 1** 显示结果如下
```shell
OHOS:/$ du -h testfile
1.8K testfile
```
# mkdir<a name="ZH-CN_TOPIC_0000001133846486"></a>
- [命令功能](#section1083613274175)
- [命令格式](#section820913118178)
- [参数说明](#section1256834121718)
- [使用指南](#section1294234115172)
- [使用实例](#section1113345211713)
- [输出说明](#section10142201012)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section1083613274175"></a>
## 命令功能<a name="section01"></a>
mkdir命令用来创建一个目录。
## 命令格式<a name="section820913118178"></a>
## 命令格式<a name="section02"></a>
mkdir \[_directory_\]
mkdir \[_-vp_\] \[_-m mode_\] \[_dirname..._\]
## 参数说明<a name="section1256834121718"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -28,7 +28,35 @@ mkdir \[_directory_\]
</th>
</tr>
</thead>
<tbody><tr id="row1312mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1314mcpsimp"><a name="p1314mcpsimp"></a><a name="p1314mcpsimp"></a>directory</p>
<tbody><tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>--help</p>
</td>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>查看mkdir命令支持的参数列表</p>
</td>
<td class="cellrowborder" valign="top" width="27.08%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
<tr id="row1312mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1314mcpsimp"><a name="p1314mcpsimp"></a><a name="p1314mcpsimp"></a>-m</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1316mcpsimp"><a name="p1316mcpsimp"></a><a name="p1316mcpsimp"></a>设置即将创建目录的权限。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1318mcpsimp"><a name="p1318mcpsimp"></a><a name="p1318mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1312mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1314mcpsimp"><a name="p1314mcpsimp"></a><a name="p1314mcpsimp"></a>-p</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1316mcpsimp"><a name="p1316mcpsimp"></a><a name="p1316mcpsimp"></a>递归逐级创建父子目录。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1318mcpsimp"><a name="p1318mcpsimp"></a><a name="p1318mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1312mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1314mcpsimp"><a name="p1314mcpsimp"></a><a name="p1314mcpsimp"></a>-v</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1316mcpsimp"><a name="p1316mcpsimp"></a><a name="p1316mcpsimp"></a>打印创建目录过程中的详细信息。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1318mcpsimp"><a name="p1318mcpsimp"></a><a name="p1318mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1312mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1314mcpsimp"><a name="p1314mcpsimp"></a><a name="p1314mcpsimp"></a>directory</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1316mcpsimp"><a name="p1316mcpsimp"></a><a name="p1316mcpsimp"></a>需要创建的目录。</p>
</td>
......@@ -38,17 +66,60 @@ mkdir \[_directory_\]
</tbody>
</table>
## 使用指南<a name="section1294234115172"></a>
## 使用指南<a name="section04"></a>
- mkdir后加所需要创建的目录名会在当前目录下创建目录。
- mkdir后加路径,再加上需要创建的目录名,即在指定目录下创建目录。
- mkdir后加参数,提供目录权限定制,目录逐级创建等功能。
> ![](../public_sys-resources/icon-notice.gif) **须知:**
>
> fatfs文件系统所有创建的文件和其挂载节点的权限属性保持一致,目前节点的权限只有用户读写权限,group和others权限不生效,
>
> 且只有读写位可设置,有rw和ro两种,因此mkdir在附加-m参数时,创建的目录权限仅有777和555两种,可执行权限也不生效。
## 使用实例<a name="section05"></a>
举例:
- mkdir testpath
- mkdir -m 777 testpath
- mkdir -pv testpath01/testpath02/testpath03
## 输出说明<a name="section06"></a>
**示例 1** 创建默认文件
## 使用实例<a name="section1113345211713"></a>
```shell
OHOS:/tmp$ mkdir testpath
OHOS:/tmp$ ll
total 2
drwxrwxrwx 1 0 0 2048 1979-12-31 00:00 testpath/
```
举例:mkdir share
**示例 2** 创建指定mode的目录
## 输出说明<a name="section10142201012"></a>
```shell
OHOS:/tmp$ mkdir -m 777 testpath
OHOS:/tmp$ ll
total 2
drwxrwxrwx 1 0 0 2048 1979-12-31 00:00 testpath/
```
**图 1** 创建 share 目录<a name="fig15480928185015"></a>
![](figure/创建-share-目录.png "创建-share-目录")
**示例 3** 逐级创建目录
```shell
OHOS:/tmp$ mkdir -pv testpath01/testpath02/testpath03
mkdir: created directory 'testpath01'
mkdir: created directory 'testpath01/testpath02'
mkdir: created directory 'testpath01/testpath02/testpath03'
OHOS:/tmp$ ll
total 2
drwxrwxrwx 1 0 0 2048 1979-12-31 00:00 testpath01/
OHOS:/tmp$ ll testpath01/
total 2
drwxrwxrwx 1 0 0 2048 1979-12-31 00:00 testpath02/
OHOS:/tmp$ ll testpath01/testpath02/
total 2
drwxrwxrwx 1 0 0 2048 1979-12-31 00:00 testpath03/
```
# mount<a name="ZH-CN_TOPIC_0000001134006264"></a>
- [命令功能](#section11631837182)
- [命令格式](#section1697638111820)
- [参数说明](#section1650151221819)
- [使用指南](#section124541520171912)
- [使用实例](#section7424625171917)
- [输出说明](#section14757018116)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section11631837182"></a>
## 命令功能<a name="section01"></a>
mount命令用来将设备挂载到指定目录。
## 命令格式<a name="section1697638111820"></a>
## 命令格式<a name="section02"></a>
mount <_device_\> <_path_\> <_name_\> \[_uid gid_\]
mount \[_-f_\] \[_-t TYPE_\] \[_-o OPTION,_\] \[\[_DEVICE_\] _DIR_\]
## 参数说明<a name="section1650151221819"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -28,51 +28,71 @@ mount <_device_\> <_path_\> <_name_\> \[_uid gid_\]
</th>
</tr>
</thead>
<tbody><tr id="row1351mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1353mcpsimp"><a name="p1353mcpsimp"></a><a name="p1353mcpsimp"></a>device</p>
<tbody><tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>--help</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1355mcpsimp"><a name="p1355mcpsimp"></a><a name="p1355mcpsimp"></a>要挂载的设备(格式为设备所在路径)</p>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>查看mount命令支持的参数列表</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1357mcpsimp"><a name="p1357mcpsimp"></a><a name="p1357mcpsimp"></a>系统拥有的设备。</p>
<td class="cellrowborder" valign="top" width="27.08%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
<tr id="row1358mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1360mcpsimp"><a name="p1360mcpsimp"></a><a name="p1360mcpsimp"></a>path</p>
<tr id="row1351mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1353mcpsimp"><a name="p1353mcpsimp"></a><a name="p1353mcpsimp"></a>-f</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1362mcpsimp"><a name="p1362mcpsimp"></a><a name="p1362mcpsimp"></a>指定目录。</p>
<p id="p1363mcpsimp"><a name="p1363mcpsimp"></a><a name="p1363mcpsimp"></a>用户必须具有指定目录中的执行(搜索)许可权。</p>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1355mcpsimp"><a name="p1355mcpsimp"></a><a name="p1355mcpsimp"></a>佯装挂载动作(实际不做挂载)。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1365mcpsimp"><a name="p1365mcpsimp"></a><a name="p1365mcpsimp"></a>N/A</p>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1357mcpsimp"><a name="p1357mcpsimp"></a><a name="p1357mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1366mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1368mcpsimp"><a name="p1368mcpsimp"></a><a name="p1368mcpsimp"></a>name</p>
<tr id="row1351mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1353mcpsimp"><a name="p1353mcpsimp"></a><a name="p1353mcpsimp"></a>-t</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1370mcpsimp"><a name="p1370mcpsimp"></a><a name="p1370mcpsimp"></a>文件系统的种类。</p>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1355mcpsimp"><a name="p1355mcpsimp"></a><a name="p1355mcpsimp"></a>文件系统的种类。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1372mcpsimp"><a name="p1372mcpsimp"></a><a name="p1372mcpsimp"></a>vfat, yaffs, jffs, ramfs, nfs,procfs, romfs.</p>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1357mcpsimp"><a name="p1357mcpsimp"></a><a name="p1357mcpsimp"></a>TYPE:vfat, yaffs, jffs, ramfs, nfs,procfs, romfs.</p>
</td>
</tr>
<tr id="row138821392219"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p15883891213"><a name="p15883891213"></a><a name="p15883891213"></a>uid gid</p>
<tr id="row1351mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1353mcpsimp"><a name="p1353mcpsimp"></a><a name="p1353mcpsimp"></a>-o</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p158834917217"><a name="p158834917217"></a><a name="p158834917217"></a>uid是指用户ID。</p>
<p id="p18500185615215"><a name="p18500185615215"></a><a name="p18500185615215"></a>gid是指组ID。</p>
<p id="p519052614387"><a name="p519052614387"></a><a name="p519052614387"></a>可选参数,缺省值uid:0,gid:0。</p>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1355mcpsimp"><a name="p1355mcpsimp"></a><a name="p1355mcpsimp"></a>挂载选项。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p178835919211"><a name="p178835919211"></a><a name="p178835919211"></a>N/A</p>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1357mcpsimp"><a name="p1357mcpsimp"></a><a name="p1357mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1351mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1353mcpsimp"><a name="p1353mcpsimp"></a><a name="p1353mcpsimp"></a>DEVICE</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1355mcpsimp"><a name="p1355mcpsimp"></a><a name="p1355mcpsimp"></a>要挂载的设备(格式为设备所在路径)。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1357mcpsimp"><a name="p1357mcpsimp"></a><a name="p1357mcpsimp"></a>系统拥有的设备。</p>
</td>
</tr>
<tr id="row1358mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1360mcpsimp"><a name="p1360mcpsimp"></a><a name="p1360mcpsimp"></a>DIR</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1362mcpsimp"><a name="p1362mcpsimp"></a><a name="p1362mcpsimp"></a>指定目录。</p>
<p id="p1363mcpsimp"><a name="p1363mcpsimp"></a><a name="p1363mcpsimp"></a>用户必须具有指定目录中的执行(搜索)许可权。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1365mcpsimp"><a name="p1365mcpsimp"></a><a name="p1365mcpsimp"></a>N/A</p>
</td>
</tr>
</tbody>
</table>
## 使用指南<a name="section124541520171912"></a>
## 使用指南<a name="section04"></a>
mount后加需要挂载的设备信息、指定目录以及设备文件格式,就能成功挂载文件系统到指定目录。
## 使用实例<a name="section7424625171917"></a>
举例:mount /dev/mmcblk0p0 /bin1/vs/sd vfat
## 使用实例<a name="section05"></a>
## 输出说明<a name="section14757018116"></a>
举例:mount -t nfs 192.168.1.3:/nfs nfs
将/dev/mmcblk0p0 挂载到/bin1/vs/sd目录
## 输出说明<a name="section06"></a>
![](figure/zh-cn_image_0000001134008688.png)
**示例 1** 将服务器端nfs目录192.168.1.3:/nfs挂载到当前系统下新建的/nfs目录:
```shell
OHOS:/$ mkdir nfs
OHOS:/$ mount -t nfs 192.168.1.3:/nfs nfs
Mount nfs on 192.168.1.3:/nfs, uid:0, gid:0
Mount nfs finished.
OHOS:/$ ls nfs/
16d.xml gpio_test ohos_test.txt userfs_vfat.img
OHOS_Image.bin hello rootfs_vfat.img
dev_tools mksh_rootfs_vfat.img test_demo
```
# mv<a name="ZH-CN_TOPIC_0000001133846432"></a>
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section01"></a>
移动文件
## 命令格式<a name="section02"></a>
mv \[_-fivn_\] _SOURCE... DEST_
## 参数说明<a name="section03"></a>
**表 1** 参数说明
<a name="table1130mcpsimp"></a>
<table><thead align="left"><tr id="row1136mcpsimp"><th class="cellrowborder" valign="top" width="21%" id="mcps1.2.4.1.1"><p id="p1138mcpsimp"><a name="p1138mcpsimp"></a><a name="p1138mcpsimp"></a>参数</p>
</th>
<th class="cellrowborder" valign="top" width="52%" id="mcps1.2.4.1.2"><p id="p1140mcpsimp"><a name="p1140mcpsimp"></a><a name="p1140mcpsimp"></a>参数说明</p>
</th>
<th class="cellrowborder" valign="top" width="27%" id="mcps1.2.4.1.3"><p id="p1142mcpsimp"><a name="p1142mcpsimp"></a><a name="p1142mcpsimp"></a>取值范围</p>
</th>
</tr>
</thead>
<tbody><tr id="row3838mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3840mcpsimp"><a name="p3840mcpsimp"></a><a name="p3840mcpsimp"></a>--help</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.2 "><p id="p3842mcpsimp"><a name="p3842mcpsimp"></a><a name="p3842mcpsimp"></a>使用帮助。</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.3 "><p id="p3844mcpsimp"><a name="p3844mcpsimp"></a><a name="p3844mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row3838mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3840mcpsimp"><a name="p3840mcpsimp"></a><a name="p3840mcpsimp"></a>-f</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.2 "><p id="p3842mcpsimp"><a name="p3842mcpsimp"></a><a name="p3842mcpsimp"></a>通过删除目标文件强制复制。</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.3 "><p id="p3844mcpsimp"><a name="p3844mcpsimp"></a><a name="p3844mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row3838mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3840mcpsimp"><a name="p3840mcpsimp"></a><a name="p3840mcpsimp"></a>-i</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p3842mcpsimp"><a name="p3842mcpsimp"></a><a name="p3842mcpsimp"></a>若指定移动的源目录或文件与目标中目录或文件同名,则会先询问是否覆盖旧文件,输入 y 直接覆盖,输入 n 取消该操作。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p3844mcpsimp"><a name="p3844mcpsimp"></a><a name="p3844mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row3838mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3840mcpsimp"><a name="p3840mcpsimp"></a><a name="p3840mcpsimp"></a>-n</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p3842mcpsimp"><a name="p3842mcpsimp"></a><a name="p3842mcpsimp"></a>不要覆盖任何已存在的文件或目录。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p3844mcpsimp"><a name="p3844mcpsimp"></a><a name="p3844mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row3838mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3840mcpsimp"><a name="p3840mcpsimp"></a><a name="p3840mcpsimp"></a>-v</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p3842mcpsimp"><a name="p3842mcpsimp"></a><a name="p3842mcpsimp"></a>目前本参数toybox官方最新代码虽然支持,但同样也不生效。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p3844mcpsimp"><a name="p3844mcpsimp"></a><a name="p3844mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1143mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1145mcpsimp"><a name="p1145mcpsimp"></a><a name="p1145mcpsimp"></a>SOURCE</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1147mcpsimp"><a name="p1147mcpsimp"></a><a name="p1147mcpsimp"></a>源文件路径。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1149mcpsimp"><a name="p1149mcpsimp"></a><a name="p1149mcpsimp"></a>目前只支持文件,不支持目录;支持多文件同时移动。</p>
</td>
</tr>
<tr id="row1150mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1152mcpsimp"><a name="p1152mcpsimp"></a><a name="p1152mcpsimp"></a>DEST</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1154mcpsimp"><a name="p1154mcpsimp"></a><a name="p1154mcpsimp"></a>目的文件路径。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1156mcpsimp"><a name="p1156mcpsimp"></a><a name="p1156mcpsimp"></a>支持目录以及文件。</p>
</td>
</tr>
</tbody>
</table>
## 使用指南<a name="section04"></a>
- 源文件路径支持“\*”和“?”通配符,“\*”代表任意多个字符,“?”代表任意单个字符。目的路径不支持通配符。当源路径可匹配多个文件时,目的路径必须为目录。
- 目的路径为目录时,该目录必须存在。此时目的文件以源文件命名。
- 目的路径为文件时,所在目录必须存在。
- 目的文件已存在则会覆盖。
## 使用实例<a name="section05"></a>
举例:
mv -i test.txt testpath/
mv test?.txt testpath/ (移动 test3.txt testA.txt test_.txt)
## 输出说明<a name="section06"></a>
**示例 1** 显示结果如下
```shell
OHOS:/$ touch test.txt
OHOS:/$ mkdir testpath
OHOS:/$ touch testpath/test.txt
OHOS:/$ mv -i test.txt testpath/
mv: overwrite 'testpath//test.txt' (Y/n):y
OHOS:/$ ls
bin etc proc storage testpath usr
dev lib sdcard system userdata vendor
OHOS:/$ cp testpath/test.txt ./
OHOS:/$ ls
bin etc proc storage test.txt userdata vendor
dev lib sdcard system testpath usr
OHOS:/$ mv -i test.txt testpath/
mv: overwrite 'testpath//test.txt' (Y/n):n
OHOS:/$ ls
bin etc proc storage test.txt userdata vendor
dev lib sdcard system testpath usr
```
**示例 2** 通配符使用
```shell
OHOS:/$ ls
bin etc proc storage test.txt testA.txt testpath usr
dev lib sdcard system test3.txt test_.txt userdata vendor
OHOS:/$ mv test?.txt testpath/
OHOS:/$ ls
bin etc proc storage test.txt userdata vendor
dev lib sdcard system testpath usr
OHOS:/$ ls testpath/
test.txt test3.txt testA.txt test_.txt
```
# rm<a name="ZH-CN_TOPIC_0000001134006266"></a>
- [命令功能](#section181141523142613)
- [命令格式](#section8800926132619)
- [参数说明](#section15476229152617)
- [使用指南](#section10578163215262)
- [使用实例](#section18548133511263)
- [输出说明](#section1565323814265)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section181141523142613"></a>
## 命令功能<a name="section01"></a>
rm命令用来删除文件或文件夹。
## 命令格式<a name="section8800926132619"></a>
## 命令格式<a name="section02"></a>
rm \[_-r_\] \[_dirname / filename_\]
rm \[_-fv_\] _FILE or rm_ \[_-rv_\] \[_PATH_ | _filename_\]...
## 参数说明<a name="section15476229152617"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -30,12 +30,26 @@ rm \[_-r_\] \[_dirname / filename_\]
</thead>
<tbody><tr id="row1520mcpsimp"><td class="cellrowborder" valign="top" width="22.220000000000002%" headers="mcps1.2.4.1.1 "><p id="p1522mcpsimp"><a name="p1522mcpsimp"></a><a name="p1522mcpsimp"></a>-r</p>
</td>
<td class="cellrowborder" valign="top" width="51.519999999999996%" headers="mcps1.2.4.1.2 "><p id="p1524mcpsimp"><a name="p1524mcpsimp"></a><a name="p1524mcpsimp"></a>可选参数,若是删除目录则需要该参数</p>
<td class="cellrowborder" valign="top" width="51.519999999999996%" headers="mcps1.2.4.1.2 "><p id="p1524mcpsimp"><a name="p1524mcpsimp"></a><a name="p1524mcpsimp"></a>删除空目录或非空目录</p>
</td>
<td class="cellrowborder" valign="top" width="26.26%" headers="mcps1.2.4.1.3 "><p id="p1526mcpsimp"><a name="p1526mcpsimp"></a><a name="p1526mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1527mcpsimp"><td class="cellrowborder" valign="top" width="22.220000000000002%" headers="mcps1.2.4.1.1 "><p id="p1529mcpsimp"><a name="p1529mcpsimp"></a><a name="p1529mcpsimp"></a>dirname/filename</p>
<tr id="row1520mcpsimp"><td class="cellrowborder" valign="top" width="22.220000000000002%" headers="mcps1.2.4.1.1 "><p id="p1522mcpsimp"><a name="p1522mcpsimp"></a><a name="p1522mcpsimp"></a>-f</p>
</td>
<td class="cellrowborder" valign="top" width="51.519999999999996%" headers="mcps1.2.4.1.2 "><p id="p1524mcpsimp"><a name="p1524mcpsimp"></a><a name="p1524mcpsimp"></a>强制删除:不需要确认,删除不存的文件在也不报错。</p>
</td>
<td class="cellrowborder" valign="top" width="26.26%" headers="mcps1.2.4.1.3 "><p id="p1526mcpsimp"><a name="p1526mcpsimp"></a><a name="p1526mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1520mcpsimp"><td class="cellrowborder" valign="top" width="22.220000000000002%" headers="mcps1.2.4.1.1 "><p id="p1522mcpsimp"><a name="p1522mcpsimp"></a><a name="p1522mcpsimp"></a>-v</p>
</td>
<td class="cellrowborder" valign="top" width="51.519999999999996%" headers="mcps1.2.4.1.2 "><p id="p1524mcpsimp"><a name="p1524mcpsimp"></a><a name="p1524mcpsimp"></a>显示删除的过程。</p>
</td>
<td class="cellrowborder" valign="top" width="26.26%" headers="mcps1.2.4.1.3 "><p id="p1526mcpsimp"><a name="p1526mcpsimp"></a><a name="p1526mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1527mcpsimp"><td class="cellrowborder" valign="top" width="22.220000000000002%" headers="mcps1.2.4.1.1 "><p id="p1529mcpsimp"><a name="p1529mcpsimp"></a><a name="p1529mcpsimp"></a>PATH/filename</p>
</td>
<td class="cellrowborder" valign="top" width="51.519999999999996%" headers="mcps1.2.4.1.2 "><p id="p1531mcpsimp"><a name="p1531mcpsimp"></a><a name="p1531mcpsimp"></a>要删除文件或文件夹的名称,支持输入路径。</p>
</td>
......@@ -45,23 +59,41 @@ rm \[_-r_\] \[_dirname / filename_\]
</tbody>
</table>
## 使用指南<a name="section10578163215262"></a>
## 使用指南<a name="section04"></a>
- rm命令一次只能删除一个文件或文件夹。
- rm命令能同时删除多个文件或文件夹。
- rm -r命令可以删除非空目录。
- 删除不存在的文件会报错。
## 使用实例<a name="section18548133511263"></a>
## 使用实例<a name="section05"></a>
举例:
1. 输入rm log1.txt
2. 输入rm -r sd
## 输出说明<a name="section1565323814265"></a>
**图 1** 用 rm 命令删除文件 log1.txt<a name="fig886111415523"></a>
![](figure/用-rm-命令删除文件-log1-txt.png "用-rm-命令删除文件-log1-txt")
**图 2** 用 rm -r 删除目录 sd<a name="fig20659194885211"></a>
![](figure/用-rm--r-删除目录-sd.png "用-rm--r-删除目录-sd")
1. 输入rm testfile
2. 输入rm -r testpath/
## 输出说明<a name="section06"></a>
**示例 1** 用 rm 命令删除文件 testfile
```shell
OHOS:/$ ls
bin etc proc storage testfile usr
dev lib sdcard system userdata vendor
OHOS:/$ rm testfile
OHOS:/$ ls
bin etc proc storage userdata vendor
dev lib sdcard system usr
```
**示例 2** 用 rm -r 删除非空目录 testpath
```shell
OHOS:/$ ls
bin etc proc storage testpath usr
dev lib sdcard system userdata vendor
OHOS:/$ rm -r testpath/
OHOS:/$ ls
bin etc proc storage userdata vendor
dev lib sdcard system usr
```
# rmdir<a name="ZH-CN_TOPIC_0000001179845933"></a>
- [命令功能](#section1839611420266)
- [命令格式](#section329574512266)
- [参数说明](#section15865747102620)
- [使用指南](#section107857508261)
- [使用实例](#section11196165315262)
- [输出说明](#section1073811415613)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section1839611420266"></a>
## 命令功能<a name="section01"></a>
rmdir命令用来删除一个目录。
## 命令格式<a name="section329574512266"></a>
## 命令格式<a name="section02"></a>
rmdir \[_dir_\]
rmdir \[_-p_\] \[_dirname..._\]
## 参数说明<a name="section15865747102620"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -28,7 +28,28 @@ rmdir \[_dir_\]
</th>
</tr>
</thead>
<tbody><tr id="row1570mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1572mcpsimp"><a name="p1572mcpsimp"></a><a name="p1572mcpsimp"></a>dir</p>
<tbody><tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>--help</p>
</td>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>查看rmdir命令支持的参数列表。</p>
</td>
<td class="cellrowborder" valign="top" width="27.08%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
<tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>-p</p>
</td>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>删除路径。</p>
</td>
<td class="cellrowborder" valign="top" width="27.08%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
<tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>--ignore-fail-on-non-empty</p>
</td>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>忽略删除非空目录导致的故障。</p>
</td>
<td class="cellrowborder" valign="top" width="27.08%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
<tr id="row1570mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1572mcpsimp"><a name="p1572mcpsimp"></a><a name="p1572mcpsimp"></a>dir</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1574mcpsimp"><a name="p1574mcpsimp"></a><a name="p1574mcpsimp"></a>需要删除目录的名称,删除目录必须为空,支持输入路径。</p>
</td>
......@@ -38,18 +59,24 @@ rmdir \[_dir_\]
</tbody>
</table>
## 使用指南<a name="section107857508261"></a>
## 使用指南<a name="section04"></a>
- rmdir命令只能用来删除目录。
- rmdir一次只能删除一个目录。
- rmdir只能删除空目录。
## 使用实例<a name="section11196165315262"></a>
## 使用实例<a name="section05"></a>
举例:输入rmdir dir
## 输出说明<a name="section1073811415613"></a>
## 输出说明<a name="section06"></a>
**图 1** 删除一个名为 dir 的目录<a name="fig118404315311"></a>
![](figure/删除一个名为-dir-的目录.png "删除一个名为-dir-的目录")
**示例 1** 删除一个名为 dir 的目录
```shell
OHOS:/test$ mkdir dir
OHOS:/test$ ls
dir
OHOS:/test$ rmdir dir/
OHOS:/test$ ls
```
# touch<a name="ZH-CN_TOPIC_0000001134006268"></a>
- [命令功能](#section17541924112716)
- [命令格式](#section866182711274)
- [参数说明](#section268912296270)
- [使用指南](#section412093332714)
- [使用实例](#section414434814354)
- [输出说明](#section1028419515711)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section405)
- [输出说明](#section06)
## 命令功能<a name="section17541924112716"></a>
## 命令功能<a name="section01"></a>
- touch命令用来在指定的目录下创建一个不存在的空文件。
- touch命令操作已存在的文件会成功,不会更新时间戳。
## 命令格式<a name="section866182711274"></a>
## 命令格式<a name="section02"></a>
touch \[_filename_\]
touch \[_filename_\]
## 参数说明<a name="section268912296270"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
<a name="table1635mcpsimp"></a>
<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>参数</p>
</th>
<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>参数说明</p>
......@@ -29,7 +30,14 @@ touch \[_filename_\]
</th>
</tr>
</thead>
<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>
<tbody><tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>--help</p>
</td>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>查看touch命令支持的参数列表</p>
</td>
<td class="cellrowborder" valign="top" width="27.08%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
<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>
</td>
<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>需要创建文件的名称。</p>
</td>
......@@ -39,21 +47,40 @@ touch \[_filename_\]
</tbody>
</table>
## 使用指南<a name="section412093332714"></a>
## 使用指南<a name="section04"></a>
- touch命令用来创建一个空文件,该文件可读写。
- 使用touch命令一次只能创建一个文件。
- 使用touch命令允许一次创建多个文件。
>![](../public_sys-resources/icon-notice.gif) **须知:**
>在系统重要资源路径下使用touch命令创建文件,会对系统造成死机等未知影响,如在/dev路径下执行touch uartdev-0,会产生系统卡死现象。
## 使用实例<a name="section414434814354"></a>
## 使用实例<a name="section05"></a>
举例:输入touch file.c 输出说明
## 输出说明<a name="section1028419515711"></a>
**图 1** 创建一个名为 file.c 的文件<a name="fig188183221532"></a>
![](figure/创建一个名为-file-c-的文件.png "创建一个名为-file-c-的文件")
## 输出说明<a name="section06"></a>
**示例 1** 创建一个名为 file.c 的文件
```shell
OHOS:/tmp$ ls
OHOS:/tmp$ touch file.c
OHOS:/tmp$ ls
file.c
OHOS:/tmp$ ll
total 0
-rwxrwxrwx 1 0 0 0 1979-12-31 00:00 file.c*
```
**示例 2** 同时创建三个文件
```shell
OHOS:/tmp$ touch testfile1 testfile2 testfile3
OHOS:/tmp$ ll
total 0
-rwxrwxrwx 1 0 0 0 1979-12-31 00:00 testfile1*
-rwxrwxrwx 1 0 0 0 1979-12-31 00:00 testfile2*
-rwxrwxrwx 1 0 0 0 1979-12-31 00:00 testfile3*
OHOS:/tmp$
```
# umount<a name="ZH-CN_TOPIC_0000001179965855"></a>
- [命令功能](#section365125133520)
- [命令格式](#section9615254123512)
- [参数说明](#section63446577355)
- [使用指南](#section92931509368)
- [使用实例](#section144311323616)
- [输出说明](#section360525113611)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section365125133520"></a>
## 命令功能<a name="section01"></a>
umount命令用来卸载指定文件系统。
## 命令格式<a name="section9615254123512"></a>
## 命令格式<a name="section02"></a>
umount \[_dir_\]
umount \[_-a \[-t TYPE\]_\] \[_dir_\]
## 参数说明<a name="section63446577355"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -28,7 +28,29 @@ umount \[_dir_\]
</th>
</tr>
</thead>
<tbody><tr id="row1726mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1728mcpsimp"><a name="p1728mcpsimp"></a><a name="p1728mcpsimp"></a>dir</p>
<tbody><tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>--help</p>
</td>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>查看umount命令支持的参数列表。</p>
</td>
<td class="cellrowborder" valign="top" width="27.08%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
<tr id="row1726mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1728mcpsimp"><a name="p1728mcpsimp"></a><a name="p1728mcpsimp"></a>-a</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1730mcpsimp"><a name="p1730mcpsimp"></a><a name="p1730mcpsimp"></a>卸载所有已挂载的目录。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1732mcpsimp"><a name="p1732mcpsimp"></a><a name="p1732mcpsimp"></a>N/A</p>
</td>
</tr>
</tr>
<tr id="row1726mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1728mcpsimp"><a name="p1728mcpsimp"></a><a name="p1728mcpsimp"></a>-t</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1730mcpsimp"><a name="p1730mcpsimp"></a><a name="p1730mcpsimp"></a>同-a选项一起使用,限制-a,只卸载-t所指定的文件系统类型。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1732mcpsimp"><a name="p1732mcpsimp"></a><a name="p1732mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row1726mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1728mcpsimp"><a name="p1728mcpsimp"></a><a name="p1728mcpsimp"></a>dir</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1730mcpsimp"><a name="p1730mcpsimp"></a><a name="p1730mcpsimp"></a>需要卸载文件系统对应的目录。</p>
</td>
......@@ -38,18 +60,28 @@ umount \[_dir_\]
</tbody>
</table>
## 使用指南<a name="section92931509368"></a>
## 使用指南<a name="section04"></a>
umount后加上需要卸载的指定文件系统的目录,即将指定文件系统卸载。
## 使用实例<a name="section144311323616"></a>
## 使用实例<a name="section05"></a>
举例:umount ./nfs 、umount -a -t nfs ./nfs
## 输出说明<a name="section06"></a>
举例:umount /bin1/vs/sd
将已在./nfs挂载的文件系统卸载
## 输出说明<a name="section360525113611"></a>
**示例 1** umount输出示例
将已在/bin1/vs/sd挂载的文件系统卸载
```shell
OHOS:/$ umount ./nfs/
umount ok
```
**图 1** umount输出示例<a name="fig2304134118557"></a>
![](figure/umount输出示例.png "umount输出示例")
**示例 2** umount指定文件类型
```shell
OHOS:/$ umount -a -t nfs ./nfs/
umount ok
```
......@@ -22,6 +22,8 @@
- **[mount](kernel-small-debug-shell-file-mount.md)**
- **[mv](kernel-small-debug-shell-file-mv.md)**
- **[partinfo](kernel-small-debug-shell-file-partinfo.md)**
- **[partition](kernel-small-debug-shell-file-partition.md)**
......@@ -41,5 +43,3 @@
- **[writeproc](kernel-small-debug-shell-file-write.md)**
- **[umount](kernel-small-debug-shell-file-umount.md)**
# ifconfig<a name="ZH-CN_TOPIC_0000001133846494"></a>
- [命令功能](#section174940284379)
- [命令格式](#section136073203715)
- [参数说明](#section6493235203710)
- [使用指南](#section05763403371)
- [使用实例](#section168802042123717)
- [输出说明](#section124638211109)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section174940284379"></a>
## 命令功能<a name="section01"></a>
ifconfig命令用来查询和设置网卡的IP地址、网络掩码、网关、硬件mac地址等参数。并能够启用/关闭网卡。
## 命令格式<a name="section136073203715"></a>
## 命令格式<a name="section02"></a>
ifconfig
......@@ -27,7 +27,7 @@ ifconfig
\[_up|down_\]
## 参数说明<a name="section6493235203710"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -129,30 +129,30 @@ ifconfig
</tbody>
</table>
## 使用指南<a name="section05763403371"></a>
## 使用指南<a name="section04"></a>
- 命令需要启动TCP/IP协议栈后才能使用。
- 由于IP冲突检测需要反应时间,每次使用ifconfig设置IP后会有2S左右的延时。
## 使用实例<a name="section168802042123717"></a>
## 使用实例<a name="section05"></a>
1. ifconfig eth0 192.168.100.31 netmask 255.255.255.0 gateway 192.168.100.1 hw ether 00:49:cb:6c:a1:31
2. ifconfig -a
3. ifconfig eth0 inet6 add 2001:a:b:c:d:e:f:d
4. ifconfig eth0 inet6 del 2001:a:b:c:d:e:f:d
## 输出说明<a name="section124638211109"></a>
## 输出说明<a name="section06"></a>
1. 设置网络参数
```
OHOS # ifconfig eth0 192.168.100.31 netmask 255.255.255.0 gateway 192.168.100.1 hw ether 00:49:cb:6c:a1:31
OHOS # ifconfig
eth0 ip:192.168.100.31 netmask:255.255.255.0 gateway:192.168.100.1
HWaddr 00:49:cb:6c:a1:31 MTU:1500 Running Default Link UP
lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1
ip6: ::1/64
HWaddr 00 MTU:0 Running Link UP
```shell
OHOS:/$ ifconfig eth0 192.168.100.31 netmask 255.255.255.0 gateway 192.168.100.1 hw ether 00:49:cb:6c:a1:31
OHOS:/$ ifconfig
lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1
ip6: ::1/64
HWaddr 00 MTU:0 Running Link UP
eth0 ip:192.168.100.31 netmask:255.255.255.0 gateway:192.168.100.1
HWaddr 00:49:cb:6c:a1:31 MTU:1500 Running Default Link UP
```
输出的各参数说明如下表所示:
......@@ -211,7 +211,7 @@ ifconfig
2. 获取协议栈统计信息
```
```shell
OHOS # ifconfig -a
RX packets:6922 errors:0 ip dropped:4312 link dropped:67 overrun:0 bytes:0 (0.0 B)
RX packets(ip6):3 errors:0 dropped:0 overrun:0 bytes:0 (0.0 B)
......@@ -283,33 +283,35 @@ ifconfig
</tbody>
</table>
3. 设置IPv6的地址信息
```
OHOS # ifconfig eth0 inet6 add 2001:a:b:c:d:e:f:d
OHOS # ifconfig
eth1 ip:192.168.3.60 netmask:255.255.255.0 gateway:0.0.0.0
HWaddr 00:0e:c6:a8:5a:c2 MTU:1500 Running Link UP
eth0 ip:192.168.2.60 netmask:255.255.255.0 gateway:0.0.0.0
ip6: 2001:A:B:C:D:E:F:D/64
HWaddr 46:44:02:02:03:03 MTU:1500 Running Link UP
lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1
ip6: ::1/64
HWaddr 00 MTU:16436 Running Link UP
```
3. 设置IPv6的地址信息
```shell
OHOS:/$ ifconfig eth0 inet6 add 2001:a:b:c:d:e:f:d
NetifStatusCallback(eth0): nsc event: 0x8
NetifStatusCallback(eth0): nsc status changed: 0
NetifStatusCallback(eth0): nsc event: 0x200
NetifStatusCallback(eth0): nsc event: 0x8
NetifStatusCallback(eth0): nsc status changed: 1
NetifStatusCallback(eth0): nsc event: 0x200
NetifStatusCallback(eth0): nsc event: 0x200
OHOS:/$ ifconfig
lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1
ip6: ::1/64
HWaddr 00 MTU:0 Running Link UP
eth0 ip:192.168.1.10 netmask:255.255.255.0 gateway:192.168.1.1
ip6: 2001:A:B:C:D:E:F:D/64
HWaddr 66:2f:e5:bd:24:e6 MTU:1500 Running Default Link UP
```
4. 删除IPv6的地址信息
```shell
OHOS:/$ ifconfig eth0 inet6 del 2001:a:b:c:d:e:f:d
NetifStatusCallback(eth0): nsc event: 0x200
OHOS:/$ ifconfig
lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1
ip6: ::1/64
HWaddr 00 MTU:0 Running Link UP
eth0 ip:192.168.1.10 netmask:255.255.255.0 gateway:192.168.1.1
HWaddr 66:2f:e5:bd:24:e6 MTU:1500 Running Default Link UP
```
OHOS # ifconfig eth0 inet6 del 2001:a:b:c:d:e:f:d
OHOS # ifconfig
eth1 ip:192.168.3.60 netmask:255.255.255.0 gateway:0.0.0.0
HWaddr 00:0e:c6:a8:5a:c2 MTU:1500 Running Link UP
eth0 ip:192.168.2.60 netmask:255.255.255.0 gateway:0.0.0.0
HWaddr 46:44:02:02:03:03 MTU:1500 Running Link UP
lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1
ip6: ::1/64
HWaddr 00 MTU:16436 Running Link UP
```
# ping<a name="ZH-CN_TOPIC_0000001133846496"></a>
- [命令功能](#section119672573385)
- [命令格式](#section869419010390)
- [参数说明](#section9877183173918)
- [使用指南](#section1097046193914)
- [使用实例](#section14564129113911)
- [输出说明](#section1621732891215)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section119672573385"></a>
## 命令功能<a name="section01"></a>
ping命令用于测试网络连接是否正常。
## 命令格式<a name="section869419010390"></a>
## 命令格式<a name="section02"></a>
ping_ _\[_-n cnt_\] \[_-w interval_\] \[_-l data\_len_\]_ <IP\>_
ping _\[-4\] \[-c cnt\] \[-f\] \[-i interval\] \[-q\] \[-s size\] <IP\>_
ping \[_-t_\] \[_-w interval_\] _<IP\>_
ping _-k_
## 参数说明<a name="section9877183173918"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -32,66 +28,88 @@ ping _-k_
</th>
</tr>
</thead>
<tbody><tr id="row2677mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2679mcpsimp"><a name="p2679mcpsimp"></a><a name="p2679mcpsimp"></a>IP</p>
<tbody><tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>--help</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2681mcpsimp"><a name="p2681mcpsimp"></a><a name="p2681mcpsimp"></a>要测试是否网络连通的IPv4地址。</p>
<td class="cellrowborder" valign="top" width="51.92%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>查看ping命令支持的参数列表</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="entry2682mcpsimpp0"><a name="entry2682mcpsimpp0"></a><a name="entry2682mcpsimpp0"></a>N/A</p>
<td class="cellrowborder" valign="top" width="27.08%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
<tr id="row2690mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2692mcpsimp"><a name="p2692mcpsimp"></a><a name="p2692mcpsimp"></a>-n cnt</p>
<tr id="row2703mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2705mcpsimp"><a name="p2705mcpsimp"></a><a name="p2705mcpsimp"></a>-4</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2707mcpsimp"><a name="p2707mcpsimp"></a><a name="p2707mcpsimp"></a>强制以IPV4通讯协议ping目标地址。</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2694mcpsimp"><a name="p2694mcpsimp"></a><a name="p2694mcpsimp"></a>执行的次数,不带本参数则默认为4次。</p>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p2710mcpsimp"><a name="p2710mcpsimp"></a><a name="p2710mcpsimp"></a>0-65500</p>
</td>
</tr>
<tr id="row2690mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2692mcpsimp"><a name="p2692mcpsimp"></a><a name="p2692mcpsimp"></a>-c CNT</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2694mcpsimp"><a name="p2694mcpsimp"></a><a name="p2694mcpsimp"></a>执行的次数,不带本参数则默认为3次。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p2696mcpsimp"><a name="p2696mcpsimp"></a><a name="p2696mcpsimp"></a>1-65535</p>
</td>
</tr>
<tr id="row2697mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2699mcpsimp"><a name="p2699mcpsimp"></a><a name="p2699mcpsimp"></a>-w interval</p>
<tr id="row2711mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2713mcpsimp"><a name="p2713mcpsimp"></a><a name="p2713mcpsimp"></a>-f</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2715mcpsimp"><a name="p2715mcpsimp"></a><a name="p2715mcpsimp"></a>隐式的ping IPv4地址,其默认参数配置等价于"-c 15 -i 0.2"</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p20501182215720"><a name="p20501182215720"></a><a name="p20501182215720"></a>N/A</p>
</td>
</tr>
<tr id="row2697mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2699mcpsimp"><a name="p2699mcpsimp"></a><a name="p2699mcpsimp"></a>-i interval</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2701mcpsimp"><a name="p2701mcpsimp"></a><a name="p2701mcpsimp"></a>发送两次ping包的时间间隔,单位毫秒。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p971414819577"><a name="p971414819577"></a><a name="p971414819577"></a>&gt;0</p>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p971414819577"><a name="p971414819577"></a><a name="p971414819577"></a>1-200</p>
</td>
</tr>
<tr id="row2703mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2705mcpsimp"><a name="p2705mcpsimp"></a><a name="p2705mcpsimp"></a>-l data_len</p>
<tr id="row2718mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2720mcpsimp"><a name="p2720mcpsimp"></a><a name="p2720mcpsimp"></a>-q</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2707mcpsimp"><a name="p2707mcpsimp"></a><a name="p2707mcpsimp"></a>ping包,即ICMP echo request报文的数据长度,不包含ICMP包头</p>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2722mcpsimp"><a name="p2722mcpsimp"></a><a name="p2722mcpsimp"></a>隐式的ping IPv4地址,如果主机还存活,则在返回 true 后停止ping</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p2710mcpsimp"><a name="p2710mcpsimp"></a><a name="p2710mcpsimp"></a>0-65500</p>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p940472325719"><a name="p940472325719"></a><a name="p940472325719"></a>N/A</p>
</td>
</tr>
<tr id="row2711mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2713mcpsimp"><a name="p2713mcpsimp"></a><a name="p2713mcpsimp"></a>-t</p>
<tr id="row2718mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2720mcpsimp"><a name="p2720mcpsimp"></a><a name="p2720mcpsimp"></a>-s SIZE</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2715mcpsimp"><a name="p2715mcpsimp"></a><a name="p2715mcpsimp"></a>表示永久ping,直到使用ping -k杀死ping线程</p>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2722mcpsimp"><a name="p2722mcpsimp"></a><a name="p2722mcpsimp"></a>设置每个ping包的大小,SIZE是以字节为单位的数据(默认为56字节)</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p20501182215720"><a name="p20501182215720"></a><a name="p20501182215720"></a>N/A</p>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p940472325719"><a name="p940472325719"></a><a name="p940472325719"></a>0-4088</p>
</td>
</tr>
<tr id="row2718mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2720mcpsimp"><a name="p2720mcpsimp"></a><a name="p2720mcpsimp"></a>-k</p>
<tr id="row2677mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2679mcpsimp"><a name="p2679mcpsimp"></a><a name="p2679mcpsimp"></a>IP</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2722mcpsimp"><a name="p2722mcpsimp"></a><a name="p2722mcpsimp"></a>杀死ping线程,停止ping</p>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2681mcpsimp"><a name="p2681mcpsimp"></a><a name="p2681mcpsimp"></a>要测试是否网络连通的IPv4地址</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p940472325719"><a name="p940472325719"></a><a name="p940472325719"></a>N/A</p>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="entry2682mcpsimpp0"><a name="entry2682mcpsimpp0"></a><a name="entry2682mcpsimpp0"></a>N/A</p>
</td>
</tr>
</tbody>
</table>
## 使用指南<a name="section1097046193914"></a>
## 使用指南<a name="section04"></a>
- ping命令用来测试到目的IP的网络连接是否正常,参数为目的IP地址。
- 如果目的IP不可达,会显示请求超时。
- 如果显示发送错误,说明没有到目的IP的路由。
- 命令需要启动TCP/IP协议栈后才能使用。
## 使用实例<a name="section14564129113911"></a>
举例:输入ping 192.168.1.10
## 使用实例<a name="section05"></a>
## 输出说明<a name="section1621732891215"></a>
举例:输入ping 192.168.1.3
**图 1** ping tftp 服务器地址<a name="fig525762695417"></a>
## 输出说明<a name="section06"></a>
**示例 1** ping tftp 服务器地址
![](figure/Snipaste_2021-01-26_10-38-58-26.png)
```shell
OHOS:/$ ping 192.168.1.3
Ping 192.168.1.3 (192.168.1.3): 56(84) bytes.
84 bytes from 192.168.1.3: icmp_seq=0 ttl=0 time=0 ms
84 bytes from 192.168.1.3: icmp_seq=0 ttl=0 time=1 ms
84 bytes from 192.168.1.3: icmp_seq=0 ttl=0 time=0 ms
--- 192.168.1.3 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss
round-trip min/avg/max = 0/0/0 ms
```
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册