提交 c7a1ec63 编写于 作者: Yansira's avatar Yansira

shell命令使用文档更新

删除了命令指导中使用的图片
Signed-off-by: Yansira's avataryansira <yansira@hotmail.com>
Change-Id: I6bdd7b0e4299287eea934d9b0f7e25e6914e6ad3
上级 86385d8b
......@@ -109,6 +109,7 @@
- [cpup](kernel-small-debug-shell-cmd-cpup.md)
- [date](kernel-small-debug-shell-cmd-date.md)
- [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)
- [help](kernel-small-debug-shell-cmd-help.md)
......@@ -118,6 +119,7 @@
- [memcheck](kernel-small-debug-shell-cmd-memcheck.md)
- [oom](kernel-small-debug-shell-cmd-oom.md)
- [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)
- [stack](kernel-small-debug-shell-cmd-stack.md)
......@@ -125,6 +127,7 @@
- [swtmr](kernel-small-debug-shell-cmd-swtmr.md)
- [systeminfo](kernel-small-debug-shell-cmd-sysinfo.md)
- [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)
......@@ -140,6 +143,7 @@
- [lsfd](kernel-small-debug-shell-file-lsfd.md)
- [mkdir](kernel-small-debug-shell-file-mkdir.md)
- [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)
- [pwd](kernel-small-debug-shell-file-pwd.md)
......@@ -153,7 +157,6 @@
- [网络命令](kernel-small-debug-shell-net.md)
- [arp](kernel-small-debug-shell-net-arp.md)
- [dhclient](kernel-small-debug-shell-net-dhclient.md)
- [dns](kernel-small-debug-shell-net-dns.md)
- [ifconfig](kernel-small-debug-shell-net-ifconfig.md)
- [ipdebug](kernel-small-debug-shell-net-ipdebug.md)
- [netstat](kernel-small-debug-shell-net-netstat.md)
......
......@@ -57,6 +57,11 @@ cpup \[_mode_\] \[_taskID_\]
## 输出说明<a name="section19871522144219"></a>
**图 1** 指令输出结果<a name="fig1251224812504"></a>
![](figure/指令输出结果.png "指令输出结果")
**示例 1** 指令输出结果
```shell
OHOS # cpup 1 5
pid 5 CpuUsage in 1s: 0.0
```
# dmesg<a name="ZH-CN_TOPIC_0000001179845915"></a>
- [命令功能](#section4643204919313)
- [命令格式](#section6553153635)
- [参数说明](#section208971157532)
- [使用指南](#section213115219413)
- [使用实例](#section13736564418)
- [输出说明](#section194005101413)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section4643204919313"></a>
## 命令功能<a name="section01"></a>
dmesg命令用于控制内核dmesg缓存区。
## 命令格式<a name="section6553153635"></a>
## 命令格式<a name="section02"></a>
dmesg
......@@ -23,7 +23,7 @@ dmesg -l \[_level_\]
dmesg \> \[_fileA_\]
## 参数说明<a name="section208971157532"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -66,9 +66,9 @@ dmesg \> \[_fileA_\]
</tr>
<tr id="row3941mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3943mcpsimp"><a name="p3943mcpsimp"></a><a name="p3943mcpsimp"></a>-s size</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p3945mcpsimp"><a name="p3945mcpsimp"></a><a name="p3945mcpsimp"></a>设置缓存区大小 size是要设置的大小。</p>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p3945mcpsimp"><a name="p3945mcpsimp"></a><a name="p3945mcpsimp"></a>设置缓存区大小size是要设置的大小。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p3947mcpsimp"><a name="p3947mcpsimp"></a><a name="p3947mcpsimp"></a>N/A</p>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p3947mcpsimp"><a name="p3947mcpsimp"></a><a name="p3947mcpsimp"></a>1-81920</p>
</td>
</tr>
<tr id="row3948mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3950mcpsimp"><a name="p3950mcpsimp"></a><a name="p3950mcpsimp"></a>-l level</p>
......@@ -88,7 +88,7 @@ dmesg \> \[_fileA_\]
</tbody>
</table>
## 使用指南<a name="section213115219413"></a>
## 使用指南<a name="section04"></a>
- 该命令依赖于LOSCFG\_SHELL\_DMESG,使用时通过menuconfig在配置项中开启"Enable Shell dmesg":
......@@ -100,14 +100,17 @@ dmesg \> \[_fileA_\]
2. 关闭串口打印会影响shell使用,建议先连接telnet再尝试关闭串口。
## 使用实例<a name="section13736564418"></a>
## 使用实例<a name="section05"></a>
举例:
输入dmesg \> /usr/dmesg.log。
输入dmesg \> dmesg.log。
## 输出说明<a name="section194005101413"></a>
## 输出说明<a name="section06"></a>
**图 1** dmesg重定向到文件。<a name="fig11150135113566"></a>
![](figure/dmesg重定向到文件.png "dmesg重定向到文件")
**示例 1** dmesg重定向到文件。
```shell
OHOS # dmesg > dmesg.log
Dmesg write log to dmesg.log success
```
......@@ -30,65 +30,133 @@ hwi
## 输出说明<a name="section075617368542"></a>
1. 显示中断信息(LOSCFG\_CPUP\_INCLUDE\_IRQ关闭)
![](figure/zh-cn_image_0000001179967527.png)
2. 显示中断信息(LOSCFG\_CPUP\_INCLUDE\_IRQ打开)
![](figure/zh-cn_image_0000001133848164.png)
**表 1** 输出说明
<a name="table809mcpsimp"></a>
<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="p172391401402"><a name="p172391401402"></a><a name="p172391401402"></a>InterruptNo</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p42381940174013"><a name="p42381940174013"></a><a name="p42381940174013"></a>中断号。</p>
</td>
</tr>
<tr id="row262535153913"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1823824014402"><a name="p1823824014402"></a><a name="p1823824014402"></a>Count</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14237040144018"><a name="p14237040144018"></a><a name="p14237040144018"></a>中断次数。</p>
</td>
</tr>
<tr id="row9683953153916"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p6236124084018"><a name="p6236124084018"></a><a name="p6236124084018"></a>Name</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p18235164014401"><a name="p18235164014401"></a><a name="p18235164014401"></a>注册中断名称。</p>
</td>
</tr>
<tr id="row85721136402"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1123434017409"><a name="p1123434017409"></a><a name="p1123434017409"></a>CYCLECOST</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p2023424094014"><a name="p2023424094014"></a><a name="p2023424094014"></a>中断的处理时间(cycles)。</p>
</td>
</tr>
<tr id="row19180126151415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p6233040164020"><a name="p6233040164020"></a><a name="p6233040164020"></a>CPUUSE</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5232840104015"><a name="p5232840104015"></a><a name="p5232840104015"></a>CPU占用率。</p>
</td>
</tr>
<tr id="row511517331702"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p14231040164014"><a name="p14231040164014"></a><a name="p14231040164014"></a>CPUUSE10s</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1323011409405"><a name="p1323011409405"></a><a name="p1323011409405"></a>最近10s CPU占用率。</p>
</td>
</tr>
<tr id="row1868124415413"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p9681144414114"><a name="p9681144414114"></a><a name="p9681144414114"></a>CPUUSE1s</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p76814443417"><a name="p76814443417"></a><a name="p76814443417"></a>最近1s CPU占用率。</p>
</td>
</tr>
<tr id="row7681164454112"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1968124412411"><a name="p1968124412411"></a><a name="p1968124412411"></a>mode</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p268134415419"><a name="p268134415419"></a><a name="p268134415419"></a>中断类型:</p>
<a name="ul682912412419"></a><a name="ul682912412419"></a><ul id="ul682912412419"><li>normal: 非共享中断。</li><li>shared: 共享中断。</li></ul>
</td>
</tr>
</tbody>
</table>
- 显示中断信息(LOSCFG\_CPUP\_INCLUDE\_IRQ关闭)
```shell
OHOS # hwi
InterruptNo Count Name
0: 0:
1: 1025641:
2: 0:
29: 824049:
37: 0: rtc_alarm
38: 24: uart_pl011
48: 3: GPIO
59: 0:
62: 530: MMC_IRQ
63: 70: MMC_IRQ
64: 280: ETH
67: 58: tde
68: 0: JPGE_0
69: 0: IVE
70: 0: VGS
72: 0: VEDU_0
73: 0: nnie0
74: 0: nnie_gdc0
75: 0: VPSS
76: 0: VI_PROC0
77: 0: JPEGD_0
83: 49455: HIFB_SOFT_INT
87: 0: AIO interrupt
88: 0: VI_CAP0
89: 0: MIPI_RX
90: 49455: VO int
91: 49456: HIFB Int
96: 17601: MMC_IRQ
100: 0: SPI_HI35XX
101: 0: SPI_HI35XX
102: 0: SPI_HI35XX
```
- 显示中断信息(LOSCFG\_CPUP\_INCLUDE\_IRQ打开)
```shell
OHOS # hwi
InterruptNo Count ATime(us) CPUUSE CPUUSE10s CPUUSE1s Mode Name
0: 0 0 0.0 0.0 0.0 normal
1: 937031 0 0.1 0.1 0.1 normal
2: 0 0 0.0 0.0 0.0 normal
29: 726166 5 0.54 0.57 0.59 normal
37: 0 0 0.0 0.0 0.0 normal rtc_alarm
38: 17 5 0.0 0.0 0.0 normal uart_pl011
48: 3 4 0.0 0.0 0.0 normal GPIO
59: 0 0 0.0 0.0 0.0 normal
62: 531 1 0.0 0.0 0.0 normal MMC_IRQ
63: 69 1 0.0 0.0 0.0 normal MMC_IRQ
64: 292 2 0.0 0.0 0.0 normal ETH
67: 54 76 0.0 0.0 0.0 shared tde
68: 0 0 0.0 0.0 0.0 shared JPGE_0
69: 0 0 0.0 0.0 0.0 shared IVE
70: 0 0 0.0 0.0 0.0 shared VGS
72: 0 0 0.0 0.0 0.0 shared VEDU_0
73: 0 0 0.0 0.0 0.0 shared nnie0
74: 0 0 0.0 0.0 0.0 shared nnie_gdc0
75: 0 0 0.0 0.0 0.0 shared VPSS
76: 0 0 0.0 0.0 0.0 shared VI_PROC0
77: 0 0 0.0 0.0 0.0 shared JPEGD_0
83: 45529 8 0.5 0.5 0.5 shared HIFB_SOFT_INT
87: 0 0 0.0 0.0 0.0 shared AIO interrupt
88: 0 0 0.0 0.0 0.0 shared VI_CAP0
89: 0 0 0.0 0.0 0.0 shared MIPI_RX
90: 45534 11 0.6 0.7 0.7 shared VO int
91: 45533 2 0.1 0.1 0.1 shared HIFB Int
96: 17383 2 0.0 0.0 0.0 normal MMC_IRQ
100: 0 0 0.0 0.0 0.0 normal SPI_HI35XX
101: 0 0 0.0 0.0 0.0 normal SPI_HI35XX
102: 0 0 0.0 0.0 0.0 normal SPI_HI35XX
```
**表 1** 输出说明
<a name="table809mcpsimp"></a>
<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="p172391401402"><a name="p172391401402"></a><a name="p172391401402"></a>InterruptNo</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p42381940174013"><a name="p42381940174013"></a><a name="p42381940174013"></a>中断号。</p>
</td>
</tr>
<tr id="row262535153913"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1823824014402"><a name="p1823824014402"></a><a name="p1823824014402"></a>Count</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p14237040144018"><a name="p14237040144018"></a><a name="p14237040144018"></a>中断次数。</p>
</td>
</tr>
<tr id="row9683953153916"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p6236124084018"><a name="p6236124084018"></a><a name="p6236124084018"></a>Name</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p18235164014401"><a name="p18235164014401"></a><a name="p18235164014401"></a>注册中断名称。</p>
</td>
</tr>
<tr id="row85721136402"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1123434017409"><a name="p1123434017409"></a><a name="p1123434017409"></a>CYCLECOST</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p2023424094014"><a name="p2023424094014"></a><a name="p2023424094014"></a>中断的处理时间(cycles)。</p>
</td>
</tr>
<tr id="row19180126151415"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p6233040164020"><a name="p6233040164020"></a><a name="p6233040164020"></a>CPUUSE</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p5232840104015"><a name="p5232840104015"></a><a name="p5232840104015"></a>CPU占用率。</p>
</td>
</tr>
<tr id="row511517331702"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p14231040164014"><a name="p14231040164014"></a><a name="p14231040164014"></a>CPUUSE10s</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p1323011409405"><a name="p1323011409405"></a><a name="p1323011409405"></a>最近10s CPU占用率。</p>
</td>
</tr>
<tr id="row1868124415413"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p9681144414114"><a name="p9681144414114"></a><a name="p9681144414114"></a>CPUUSE1s</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p76814443417"><a name="p76814443417"></a><a name="p76814443417"></a>最近1s CPU占用率。</p>
</td>
</tr>
<tr id="row7681164454112"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1968124412411"><a name="p1968124412411"></a><a name="p1968124412411"></a>mode</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p268134415419"><a name="p268134415419"></a><a name="p268134415419"></a>中断类型:</p>
<a name="ul682912412419"></a><a name="ul682912412419"></a><ul id="ul682912412419"><li>normal: 非共享中断。</li><li>shared: 共享中断。</li></ul>
</td>
</tr>
</tbody>
</table>
......@@ -32,7 +32,7 @@ log level \[_levelNum_\]
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p254mcpsimp"><a name="p254mcpsimp"></a><a name="p254mcpsimp"></a>配置日志打印等级。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p256mcpsimp"><a name="p256mcpsimp"></a><a name="p256mcpsimp"></a>[0x0,0x5]</p>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p256mcpsimp"><a name="p256mcpsimp"></a><a name="p256mcpsimp"></a>[0,5]</p>
</td>
</tr>
</tbody>
......@@ -62,13 +62,18 @@ log level \[_levelNum_\]
- 若log level命令不加\[levelNum\]参数,则默认查看当前打印等级,并且提示使用方法。
- 开源小型系统源码设置level 为4或者5会有超多打印。
## 使用实例<a name="section176301333259"></a>
举例:
输入log level 4
输入log level 3
## 输出说明<a name="section14354765415"></a>
![](figure/zh-cn_image_0000001179847649.png)
```shell
OHOS # log level 3
Set current log level WARN
```
......@@ -30,9 +30,36 @@ memcheck
## 输出说明<a name="section13406205385413"></a>
**图 1** 当前没有内存越界<a name="fig1115313610438"></a>
![](figure/当前没有内存越界.png "当前没有内存越界")
**示例 1** 当前没有内存越界
**图 2** 出现内存越界<a name="fig6414131084419"></a>
![](figure/出现内存越界.png "出现内存越界")
```shell
OHOS # memcheck
system memcheck over, all passed!
```
**示例 2** 出现内存越界<a name="fig6414131084419"></a>
```shell
[L0S DLnkCheckMenl 349, memory check
stFreeNodeInfo.pstPrev:0x7e0d31f3 is out of legal mem range[0x80ba5f40, 0х83d00000]
cur node: 0x81f2ce0c
pre node: 0x81f28a98
pre node was allocated by task:sofia
uwEхcTуpe = 0х2
puмExcBuffAddr pc = 0x803ad7a4
puwExcBuffAddr lr = 0x803ad7a4
puwExcBuffAddr sp = 0х80cb7de0
puwExcBuffAddr fp = 0x80cb7dec
*******backtrace begin*******
traceback 0 -- lr = 0х8037cb84
traceback 0 -- fp = 0х80cb7e1c
traceback 1 -- lr = 0х8037033c
traceback 1 -- fp = 0х80cb7e24
traceback 2 -- lr = 0x8000d108
traceback 2 -- fp = 0х80cb7e94
traceback 3 -- lr = 0х8037c7ac
traceback 3 -- fp = 0х80cb7ea4
traceback 4 -- lr = 0x803ad9e8
traceback 4 -- fp = 9x11111111
```
......@@ -73,10 +73,52 @@ oom -h | --help
>![](../public_sys-resources/icon-note.gif) **说明:**
>当系统内存不足时,会打印出内存不足的提示信息。
## 输出说明<a name="section12742311179"></a>
![](figure/zh-cn_image_0000001134008030.png)
```shell
T:20 Enter:IT MEM 00M 001
[oom] 0S is in low memory state
total physical memory: 0x1bcf000(byte), used: 0x1b50000(byte) ,free: 0x7f000(byte), low memory threshold: 0x80000(byte)
[oom] candidate victim process init pid: 1, actual phy mem byte:82602
[oom] candidate victim process shell pid: 3, actual phy mem byte:14950e
[oom] candidate victim process testsuits app pid: 4, actual phy mem byte:1334598
[oom] candidate victim process UserProcess12 pid: 12, actual phy mem byte:25951558
[oom] max phy mem used process UserProcess12 pid: 12, actual phy mem 25951558
################excFrom: User!####################
data abort fsr:0x817, far:0x225af000
Abort caused by a write instruction. Translation fault, page
excType: data abort
processName = UserProcess12
processID = 12
process aspace = 0х01000000 -> 0х3f000000
taskName = threado
taskID = 22
task user stack = 0х20e17000 -> 0х20e21000
pc = 0x93969dc in /usr/bin/testsuits app ---> 0x19f9dc
ulr = 0x93969cc in /usr/bin/testsuits app ---> 0x19f9cc
usp = 0х20e20c68fp = 0x20e20c8c
R0 = 0х20e35000
R1 = 0x225af000
R2 = 0x0
R3 = 0х28e35000
R4 = 0х0
R5 = 0х9500000
R6 = 0х14
R7 = 0х97822c4
R8 = 0x970cfa8
R9 = 0x9090909
R10 = 0xa0a0a0a
R11 = 0x20e20c8c
R12 = 0х0
CPSR = 0х80000010
*******backtrace beain*******
traceback 0 -- lr = 0x9242e1c fp = 0х20e20cc4 lr in /usr/bin/testsuits apr 0x4be1c
traceback 1 -- 1r = 0х92430cc fp = 0x20e20cdc lr in /usr/bin/testsuits app --> 0x4c0cc
traceback 2 -- 1r = 0x9396ab0 fp = 0x20e20cec lr in /usr/bin/testsuits app -> 0х19fab0
traceback 3 -- lr = 0x9393eb4 fp = 0x20e20cf4 lr in /usr/bin/testsuits ap --> 0x19ceb4
traceback 4 -- lr = 0x92427d4 fp = 0x20e20d44 lr in /usr/bin/testsuits app --> 0x4b7d4
traceback 5 -- 1r = 0x20c4df50 fp = 0хb0b0b0b 1r in /1ib/libc.so - -> 0x62f50
```
**表 2** 输出说明
......@@ -116,4 +158,3 @@ oom -h | --help
</tr>
</tbody>
</table>
......@@ -29,8 +29,34 @@ Debug版本才具备的命令。
## 输出说明<a name="section075617368542"></a>
**图 1** 查看物理页使用情况<a name="fig19209202618618"></a>
![](figure/查看物理页使用情况.png "查看物理页使用情况")
**示例 1** 查看物理页使用情况
```shell
OHOS # pmm
phys_seg base size free_pages
-------- ------- ---------- ---------
0x4065552c 0x809b0000 0x07550000 22344
order = 0, free_count = 16
order = 1, free_count = 12
order = 2, free_count = 8
order = 3, free_count = 6
order = 4, free_count = 13
order = 5, free_count = 16
order = 6, free_count = 12
order = 7, free_count = 4
order = 8, free_count = 79
active anon 0
inactive anon 0
active file 1385
inactice file 84
pmm pages: total = 30032, used = 7688, free = 22344
pathCache number = 325
pathCache memory size = 17621(B)
Vnode number = 67
Vnode memory size = 10720(B)
```
**表 1** 输出说明
......@@ -88,4 +114,3 @@ Debug版本才具备的命令。
</tr>
</tbody>
</table>
......@@ -60,12 +60,44 @@ sem \[_ID__ / fulldata_\]
## 输出说明<a name="section1975118519456"></a>
**图 1** 查询所有在用的信号量信息<a name="fig18750181620222"></a>
![](figure/查询所有在用的信号量信息.png "查询所有在用的信号量信息")
**示例 1** 查询所有在用的信号量信息
```shell
OHOS # sem
SemID Count
---------- -----
0x00000000 1
SemID Count
---------- -----
0x00000001 0
SemID Count
---------- -----
0x00000002 0
SemID Count
---------- -----
0x00000003 1
SemID Count
---------- -----
0x00000004 0
SemID Count
---------- -----
0x00000005 1
SemID Count
---------- -----
0x00000006 0
```
**表 2** 输出说明
<a name="table487mcpsimp"></a>
<table><thead align="left"><tr id="row492mcpsimp"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p494mcpsimp"><a name="p494mcpsimp"></a><a name="p494mcpsimp"></a>输出</p>
</th>
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p496mcpsimp"><a name="p496mcpsimp"></a><a name="p496mcpsimp"></a>说明</p>
......
......@@ -29,10 +29,18 @@ stack
## 输出说明<a name="section075617368542"></a>
**图 1** 系统堆栈使用情况<a name="fig478715471421"></a>
**示例 1** 系统堆栈使用情况
```shell
OHOS # stack
![](figure/zh-cn_image_0000001133848370.png)
stack name cpu id stack addr total size used size
---------- ------ --------- -------- --------
svc_stack 1 0x405c4000 0x2000 0x484
svc_stack 0 0x405c6000 0x2000 0xae4
exc_stack 1 0x405c8000 0x1000 0x0
exc_stack 0 0x405c9000 0x1000 0x0
```
**表 1** 输出说明
......@@ -70,4 +78,3 @@ stack
</tr>
</tbody>
</table>
......@@ -32,14 +32,14 @@ su \[_uid_\] \[_gid_\]
</td>
<td class="cellrowborder" valign="top" width="51.93%" headers="mcps1.2.4.1.2 "><p id="p14138191243"><a name="p14138191243"></a><a name="p14138191243"></a>目标用户的用户id值。</p>
</td>
<td class="cellrowborder" valign="top" width="27.07%" headers="mcps1.2.4.1.3 "><a name="ul14151675449"></a><a name="ul14151675449"></a><ul id="ul14151675449"><li>为空。</li><li>[0,60000]</li></ul>
<td class="cellrowborder" valign="top" width="27.07%" headers="mcps1.2.4.1.3 "><a name="ul14151675449"></a><a name="ul14151675449"></a><a name="p14138191456"></a>[0,60000]</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>gid</p>
</td>
<td class="cellrowborder" valign="top" width="51.93%" headers="mcps1.2.4.1.2 "><p id="p48748461789"><a name="p48748461789"></a><a name="p48748461789"></a>目标用户的群组id值。</p>
</td>
<td class="cellrowborder" valign="top" width="27.07%" headers="mcps1.2.4.1.3 "><a name="ul10433713134417"></a><a name="ul10433713134417"></a><ul id="ul10433713134417"><li>为空。</li><li>[0,60000]</li></ul>
<td class="cellrowborder" valign="top" width="27.07%" headers="mcps1.2.4.1.3 "><a name="ul10433713134417"></a><a name="ul10433713134417"></a><a name="p14138191123"></a>[0,60000]</p>
</td>
</tr>
</tbody>
......@@ -57,6 +57,17 @@ su \[_uid_\] \[_gid_\]
## 输出说明<a name="section125021924194613"></a>
**图 1** **切换到**为uid为1000,gid为1000的用户<a name="fig666918538448"></a>
![](figure/切换到为uid为1000-gid为1000的用户.png "切换到为uid为1000-gid为1000的用户")
**示例 1** **切换到**为uid为1000,gid为1000的用户
```shell
OHOS # ls
Directory /data/system/param:
-rw-r--r-- 0 u:0 g:0 hello_1.txt
OHOS # su 1000 1000
OHOS # touch hello 2.txt
OHOS # ls
Directory /data/system/param:
-rw-r--r-- O u:1000 g:1000 hello 2.txt
-гw-r--r-- 0 u:0 g:0 hello_1.txt
```
......@@ -49,11 +49,41 @@ swtmr \[_ID_\]
## 输出说明<a name="section1541991614710"></a>
**图 1** 查询所有软件定时器相关信息<a name="fig9860611451"></a>
![](figure/查询所有软件定时器相关信息.png "查询所有软件定时器相关信息")
**示例 1** 查询所有软件定时器相关信息
**图 2** 查询对应 ID 的软件定时器信息<a name="fig22051415124512"></a>
![](figure/查询对应-ID-的软件定时器信息.png "查询对应-ID-的软件定时器信息")
```shell
OHOS # swtmr
SwTmrID State Mode Interval Count Arg handlerAddr
---------- ------- ------- --------- ------- ---------- --------
0x00000000 Ticking Period 100 77 0x40802a50 0x4037b8a0
SwTmrID State Mode Interval Count Arg handlerAddr
---------- ------- ------- --------- ------- ---------- --------
0x00000001 Ticking Period 1000 876 0x00000000 0x4037fc04
SwTmrID State Mode Interval Count Arg handlerAddr
---------- ------- ------- --------- ------- ---------- --------
0x00000002 Ticking Period 100 76 0x00000000 0x403727f4
SwTmrID State Mode Interval Count Arg handlerAddr
---------- ------- ------- --------- ------- ---------- --------
0x00000016 Ticking NSD 10 6 0x8021e000 0x401fe7d8
SwTmrID State Mode Interval Count Arg handlerAddr
---------- ------- ------- --------- ------- ---------- --------
0x00000079 Ticking NSD 30000 1749 0x406189d8 0x40160e1c
```
**示例 2** 查询对应 ID 的软件定时器信息
```shell
OHOS # swtmr 1
SwTmrID State Mode Interval Count Arg handlerAddr
---------- ------- ------- --------- ------- ---------- --------
0x00000001 Ticking Period 1000 841 0x00000000 0x4037fc04
```
**表 2** 输出说明
......
......@@ -48,8 +48,36 @@ task/task -a
## 输出说明<a name="section19299103465015"></a>
**图 1** 查询任务部分信息<a name="fig13685195715451"></a>
![](figure/查询任务部分信息.png "查询任务部分信息")
**示例 1** 查询任务部分信息
```shell
OHOS # task
allCpu(%): 3.54 sys, 196.46 idle
PID PPID PGID UID Status VirtualMem ShareMem PhysicalMem CPUUSE10s PName
1 -1 1 0 Pending 0x33b000 0xbb000 0x4dc8b 0.0 init
2 -1 2 0 Pending 0x193318e 0 0x193318e 1.11 KProcess
3 1 3 7 Pending 0x730000 0x1a2000 0x1d34f6 0.0 foundation
4 1 4 8 Pending 0x35e000 0xb8000 0x56777 0.0 bundle_daemon
5 1 5 1 Pending 0xdfa000 0x2e7000 0x1487ce 0.0 appspawn
6 1 6 0 Pending 0x688000 0x137000 0x11c518 0.0 media_server
7 1 7 0 Pending 0x9d2000 0x103000 0xa1ddf 0.89 wms_server
8 1 1 1000 Running 0x2bf000 0x8f000 0x2a8c6 0.0 shell
9 5 5 101 Pending 0x11ea000 0x2f9000 0x20429d 0.97 com.huawei.launcher
11 1 11 0 Pending 0x4d4000 0x112000 0xe0ad7 0.0 deviceauth_service
12 1 12 0 Pending 0x34f000 0xbd000 0x519ee 0.0 sensor_service
13 1 13 2 Pending 0x34e000 0xb3000 0x523d9 0.0 ai_server
14 1 14 0 Pending 0x61f000 0x13b000 0x16841c 0.50 softbus_server
TID PID Affi CPU Status StackSize WaterLine CPUUSE10s MEMUSE TaskName
23 1 0x3 -1 Pending 0x3000 0xe44 0.0 0 init
1 2 0x1 -1 Pending 0x4000 0x2c4 0.37 0 Swt_Task
2 2 0x3 -1 Pending 0x4000 0x204 0.0 0 system_wq
3 2 0x2 -1 Pending 0x4000 0x514 0.65 0 Swt_Task
4 2 0x3 -1 Pending 0x1000 0x36c 0.0 0 ResourcesTask
7 2 0x3 -1 Pending 0x4e20 0xa5c 0.0 0 PlatformWorkerThread
```
**表 2** 输出说明
......@@ -122,4 +150,3 @@ task/task -a
</tr>
</tbody>
</table>
......@@ -32,21 +32,21 @@ vmm \[_pid_\]
</thead>
<tbody><tr id="row3913mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p17944444181717"><a name="p17944444181717"></a><a name="p17944444181717"></a>-a</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p209441344121716"><a name="p209441344121716"></a><a name="p209441344121716"></a>输出所有进程的虚拟内存使用情况</p>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p209441344121716"><a name="p209441344121716"></a><a name="p209441344121716"></a>输出所有进程的虚拟内存使用情况</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p3919mcpsimp"><a name="p3919mcpsimp"></a><a name="p3919mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row3920mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p1944124412171"><a name="p1944124412171"></a><a name="p1944124412171"></a>-h | --help</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1494494441713"><a name="p1494494441713"></a><a name="p1494494441713"></a>命令格式说明</p>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1494494441713"><a name="p1494494441713"></a><a name="p1494494441713"></a>命令格式说明</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p3926mcpsimp"><a name="p3926mcpsimp"></a><a name="p3926mcpsimp"></a>N/A</p>
</td>
</tr>
<tr id="row3934mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p5945444181720"><a name="p5945444181720"></a><a name="p5945444181720"></a>pid</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1594515442177"><a name="p1594515442177"></a><a name="p1594515442177"></a>进程ID,说明指定进程的虚拟内存使用情况</p>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1594515442177"><a name="p1594515442177"></a><a name="p1594515442177"></a>进程ID,说明指定进程的虚拟内存使用情况</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p3940mcpsimp"><a name="p3940mcpsimp"></a><a name="p3940mcpsimp"></a>[0,63]</p>
</td>
......@@ -64,8 +64,33 @@ vmm \[_pid_\]
## 输出说明<a name="section075617368542"></a>
**图 1** PID为3的进程虚拟内存使用信息<a name="fig17645956122214"></a>
![](figure/PID为3的进程虚拟内存使用信息.png "PID为3的进程虚拟内存使用信息")
**示例 1** PID为3的进程虚拟内存使用信息
```shell
OHOS # vmm 3
PID aspace name base size pages
---- ------ ---- ---- ----- ----
3 0x408c0118 foundation 0x01000000 0x3e000000 800
region name base size mmu_flags pages pg/ref
------ ---- ---- ---- --------- ----- -----
0x408cb364 /bin/foundation 0x06da3000 0x00001000 CH US RD 1 1
0x408cb80c /bin/foundation 0x06da4000 0x00001000 CH US RD EX 1 1
0x408cb720 /bin/foundation 0x06da5000 0x00001000 CH US RD 1 1
0x408cb9a8 /bin/foundation 0x06da6000 0x00001000 CH US RD WR 1 1
0x413efde4 HEAP 0x12b43000 0x00015000 CH US RD WR 19 19
0x408c3d34 /lib/libc.so 0x23b08000 0x0004a000 CH US RD 25 2
0x408cbd44 /lib/libc.so 0x23b52000 0x00068000 CH US RD EX 58 10
0x408c3dc0 /lib/libc.so 0x23bba000 0x00002000 CH US RD WR 2 2
0x408cc128 /lib/libc.so 0x23bbc000 0x00002000 CH US RD WR 2 2
0x408d1634 MMAP 0x23bbe000 0x00005000 CH US RD WR 5 5
0x408c4e10 VDSO 0x23bc3000 0x00002000 CH US RD EX 2 2
0x408dbaec /lib/libc++.so 0x23bc5000 0x00046000 CH US RD 51 5
0x408deba8 /lib/libc++.so 0x23c0b000 0x0009f000 CH US RD EX 29 10
0x408debf4 /lib/libc++.so 0x23caa000 0x00006000 CH US RD 6 6
0x408c3ce0 /lib/libc++.so 0x23cb0000 0x00001000 CH US RD WR 1 1
```
**表 2** 进程基本信息
......@@ -155,4 +180,3 @@ vmm \[_pid_\]
</tr>
</tbody>
</table>
......@@ -92,9 +92,50 @@ watch -n 2 -c 6 task
## 输出说明<a name="section5791253155517"></a>
**图 1** watch task 结果<a name="fig125034159462"></a>
![](figure/watch-task-结果.png "watch-task-结果")
**示例 1** watch task 结果
```shell
OHOS # watch -n 2 -c 6 task
Thu Jan 1 23:57:13 1970
OHOS #
allCpu(%): 3.55 sys, 196.45 idle
PID PPID PGID UID Status VirtualMem ShareMem PhysicalMem CPUUSE10s PName
1 -1 1 0 Pending 0x33b000 0xbb000 0x4dc8b 0.0 init
2 -1 2 0 Running 0x19524f2 0 0x19524f2 1.14 KProcess
3 1 3 7 Pending 0x730000 0x1a2000 0x1d34f6 0.0 foundation
4 1 4 8 Pending 0x35e000 0xb8000 0x56777 0.0 bundle_daemon
5 1 5 1 Pending 0xdfa000 0x2e7000 0x1487ce 0.0 appspawn
6 1 6 0 Pending 0x688000 0x137000 0x11c518 0.0 media_server
7 1 7 0 Pending 0x9d2000 0x103000 0xa1ddf 0.95 wms_server
8 1 1 1000 Running 0x2bf000 0x8f000 0x2a8c6 0.0 shell
9 5 5 101 Pending 0x11ea000 0x2f9000 0x20429d 1.2 com.huawei.launcher
11 1 11 0 Pending 0x4d4000 0x112000 0xe0ad7 0.0 deviceauth_service
12 1 12 0 Pending 0x34f000 0xbd000 0x519ee 0.0 sensor_service
13 1 13 2 Pending 0x34e000 0xb3000 0x523d9 0.0 ai_server
14 1 14 0 Pending 0x61f000 0x13b000 0x16841c 0.51 softbus_server
TID PID Affi CPU Status StackSize WaterLine CPUUSE10s MEMUSE TaskName
23 1 0x3 -1 Pending 0x3000 0xe44 0.0 0 init
1 2 0x1 -1 Pending 0x4000 0x2c4 0.64 0 Swt_Task
2 2 0x3 -1 Pending 0x4000 0x204 0.0 0 system_wq
3 2 0x2 -1 Pending 0x4000 0x514 0.40 0 Swt_Task
4 2 0x3 -1 Pending 0x1000 0x36c 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 0xa5c 0.0 0 PlatformWorkerThread
10 2 0x3 -1 PendTime 0x4000 0x3e4 0.5 0 hi_vdec_thread
11 2 0x3 -1 Pending 0x3000 0x4cc 0.0 0 bcache_async_task
12 2 0x3 -1 Pending 0x2710 0x224 0.0 0 LiteOS usb pnp notify handle kt
13 2 0x3 -1 Pending 0x4000 0x204 0.0 0 vibrator_queue
14 2 0x3 -1 Pending 0x3000 0x37c 0.0 0 bcache_async_task
15 2 0x3 -1 Pending 0x20000 0x3e4 0.0 0 eth_irq_Task
16 2 0x3 -1 PendTime 0x2000 0x3a4 0.0 0 MessageDispatcher
17 2 0x3 0 Running 0x3000 0x73c 0.0 0 shellcmd_watch
18 2 0x3 -1 Pending 0x2710 0x3ac 0.0 0 GPIO_IRQ_TSK_0_4
```
>![](../public_sys-resources/icon-note.gif) **说明:**
>示例中,总共有6次task命令打印,每次间隔2秒,截图为最后一次打印详情。
>示例中,总共有6次task命令打印,每次间隔2秒,示例1为最后一次打印详情。
......@@ -48,6 +48,10 @@ cat用于显示文本文件的内容。
## 输出说明<a name="section183926225561"></a>
**图 1** 查看 hello-harmony.txt 文件的信息<a name="fig15578152824618"></a>
![](figure/查看-hello-harmony-txt-文件的信息.png "查看-hello-harmony-txt-文件的信息")
**示例 1** 查看 hello-harmony.txt 文件的信息
```shell
OHOS # cat hello-harmony.txt
OHOS # Hello Harmony ;)
```
......@@ -45,6 +45,7 @@ cd \[_path_\]
- 路径名以 /(斜杠)开头时,表示根目录。
- .(点)表示当前目录。
- ..(点点)表示父目录。
- cd - 可以在最近访问的两个目录切换。
## 使用实例<a name="section211620301412"></a>
......@@ -52,6 +53,12 @@ cd \[_path_\]
## 输出说明<a name="section1968117214577"></a>
**图 1** 显示结果如下<a name="fig16500959144812"></a>
![](figure/显示结果如下.png "显示结果如下")
**示例 1** 显示结果如下
```shell
OHOS:/nfs$ cd ../
OHOS:/$ ls
bin etc nfs sdcard system tmp vendor
dev lib proc storage test usr
```
# format<a name="ZH-CN_TOPIC_0000001134006262"></a>
- [命令功能](#section1922331919169)
- [命令格式](#section249226169)
- [参数说明](#section985173416177)
- [使用指南](#section1510162714162)
- [使用实例](#section25691431161611)
- [输出说明](#section17368112365920)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section1922331919169"></a>
## 命令功能<a name="section01"></a>
format指令用于格式化磁盘。
## 命令格式<a name="section249226169"></a>
## 命令格式<a name="section02"></a>
format <_dev\_inodename_\> <_sectors_\> <_option_\> \[_label_\]
## 参数说明<a name="section985173416177"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -51,19 +51,22 @@ format <_dev\_inodename_\> <_sectors_\> <_option_\> \[_label_\]
</tbody>
</table>
## 使用指南<a name="section1510162714162"></a>
## 使用指南<a name="section04"></a>
- format指令用于格式化磁盘,设备名可以在dev目录下查找。format时必须安装存储卡。
- format只能格式化U盘、sd和mmc卡,对Nand flash和Nor flash格式化不起作用。
- sectors参数必须传入合法值,传入非法参数可能引发异常。
## 使用实例<a name="section25691431161611"></a>
## 使用实例<a name="section05"></a>
举例:输入format /dev/mmcblk0 128 2
举例:输入format /dev/mmcblk1 128 2
## 输出说明<a name="section17368112365920"></a>
## 输出说明<a name="section06"></a>
结果如下
![](figure/zh-cn_image_0000001134008686.png)
结果如下:
```shell
OHOS # format /dev/mmcblk1 128 2
Format to FAT32, 128 sectors per cluster.
format /dev/mmcblk1 Success
```
......@@ -24,6 +24,44 @@ lsfd命令显示当前已经打开文件的fd号以及文件的名字。
## 输出说明<a name="section42491639151813"></a>
**图 1** lsfd输出说明<a name="fig11407101617206"></a>
![](figure/lsfd输出说明.png "lsfd输出说明")
**示例 1** lsfd输出说明
```shell
OHOS # lsfd
fd filename
3 /dev/console1
4 /dev/hilog
5 /dev/hilog
6 /dev/hilog
7 /dev/lite_ipc
8 /dev/hilog
9 /dev/lite_ipc
10 /dev/vb
11 /dev/hilog
12 /dev/vo
13 /dev/hilog
14 /dev/hilog
15 /dev/sys
16 /dev/lite_ipc
17 /dev/lite_ipc
18 /dev/hi_tde
19 /dev/fb0
20 /dev/vo
21 /dev/mmz_userdev
22 /dev/hi_tde
23 /dev/lite_ipc
24 /dev/hdf/hdf_input_event1
25 /dev/lite_ipc
26 /dev/mmz_userdev
27 /dev/lite_ipc
28 /dev/hilog
29 /dev/hilog
30 /dev/hdf/hdf_sensor_manager_ap
31 /dev/hilog
32 /dev/lite_ipc
33 /dev/lite_ipc
34 /dev/lite_ipc
```
......@@ -48,5 +48,16 @@ partinfo /dev/mmcblk0p0
## 输出说明<a name="section66689331412"></a>
![](figure/zh-cn_image_0000001133848906.png)
```shell
OHOS # partinfo /dev/mmcblk0p0
part info :
disk id : 0
part_id in system: 1
part no in disk : 0
part no in mbr : 0
part filesystem : 00
part sec start : 20480
part sec count : 102400
```
......@@ -58,5 +58,8 @@ partition \[_nand / spinor_\]
查看spinor flash分区信息
![](figure/zh-cn_image_0000001179848349.png)
```shell
OHOS # partition spinor
spinor partition num:0, blkdev name:/dev/spinorblk0, mountpt:/, startaddr:0x00500000, length:0x00a00000
```
......@@ -29,6 +29,10 @@ pwd 命令将当前目录的全路径名称(从根目录)写入标准输出
## 输出说明<a name="section116313389418"></a>
**图 1** 查看当前路径<a name="fig1659412213529"></a>
![](figure/查看当前路径.png "查看当前路径")
**示例 1** 查看当前路径
```shell
OHOS:/sdcard/nfs$ pwd
/sdcard/nfs
```
......@@ -47,6 +47,20 @@ statfs \[_directory_\]
statfs /nfs
**图 1** statfs输出说明<a name="fig1810654276"></a>
![](figure/statfs输出说明.png "statfs输出说明")
**示例 1** statfs输出说明
```shell
OHOS # statfs ./nfs
statfs got:
f_type = 26985
cluster_size = 512
total_clusters = 1579575176
free_clusters = 499254808
avail_clusters = 499254808
f_namelen = 255
./nfs
total size: 808742490112 Bytes
free size: 255618461696 Bytes
```
......@@ -74,10 +74,13 @@ arp \[_-i IF_\] -d _IPADDR_
1. 输入arp
**图 1** 打印整个 ARP 缓存表<a name="fig19980104045317"></a>
**示例 1** 打印整个 ARP 缓存表
![](figure/Snipaste_2021-01-26_10-38-58.png)
```shell
OHOS # arp
Address HWaddress Iface Type
192.168.1.10 E6:2B:99:2C:4B:20 eth0 static
```
**表 2** 参数说明
......@@ -111,4 +114,3 @@ arp \[_-i IF_\] -d _IPADDR_
</tbody>
</table>
# dhclient<a name="ZH-CN_TOPIC_0000001179845937"></a>
- [命令功能](#section366714216619)
- [命令格式](#section8833164614615)
- [参数说明](#section12809111019453)
- [使用指南](#section15935131220717)
- [使用实例](#section79281818476)
- [输出说明](#section12742311179)
- [命令功能](#section01)
- [命令格式](#section02)
- [参数说明](#section03)
- [使用指南](#section04)
- [使用实例](#section05)
- [输出说明](#section06)
## 命令功能<a name="section366714216619"></a>
## 命令功能<a name="section01"></a>
设置和查看dhclient的参数。
## 命令格式<a name="section8833164614615"></a>
## 命令格式<a name="section02"></a>
dhclient <_netif name_\>
dhclient -x <_netif name_\>
dhclient -gb <_netif name_\>
dhclient -sv <_vendor_\>
dhclient -gv
dhclient -gd <_index_\>
dhclient -sd <_dns\_ip_\>
## 参数说明<a name="section12809111019453"></a>
## 参数说明<a name="section03"></a>
**表 1** 参数说明
......@@ -40,7 +30,14 @@ dhclient -sd <_dns\_ip_\>
</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>&lt;netif name&gt;</p>
<tbody><tr id="row1110416513817"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p110445143817"><a name="p110445143817"></a><a name="p110445143817"></a>-h | --help</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1510414514386"><a name="p1510414514386"></a><a name="p1510414514386"></a>查看dhclient命令支持的参数列表,及使用方式。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1410445183811"><a name="p1410445183811"></a><a name="p1410445183811"></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>&lt;netif name&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>启动对应网卡的dhcp请求。</p>
</td>
......@@ -54,85 +51,36 @@ dhclient -sd <_dns\_ip_\>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p1410445183811"><a name="p1410445183811"></a><a name="p1410445183811"></a>网卡名字,eth0。</p>
</td>
</tr>
<tr id="row8809123074012"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p180913307408"><a name="p180913307408"></a><a name="p180913307408"></a>-gb &lt;netif name&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p280913309400"><a name="p280913309400"></a><a name="p280913309400"></a>查看对应网卡的dhcp请求是否完成。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p43801815411"><a name="p43801815411"></a><a name="p43801815411"></a>网卡名字,eth0。</p>
</td>
</tr>
<tr id="row46581611174117"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p3658171124116"><a name="p3658171124116"></a><a name="p3658171124116"></a>-sv &lt;vendor&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p3658131111410"><a name="p3658131111410"></a><a name="p3658131111410"></a>设置dhcp请求的厂商信息。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p14658311184115"><a name="p14658311184115"></a><a name="p14658311184115"></a>厂商信息,长度是32个字符。</p>
</td>
</tr>
<tr id="row14729211134217"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p972915115426"><a name="p972915115426"></a><a name="p972915115426"></a>-gv</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p272951113426"><a name="p272951113426"></a><a name="p272951113426"></a>查看dhcp请求的厂商信息。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p117291111134216"><a name="p117291111134216"></a><a name="p117291111134216"></a>N/A</p>
</td>
</tr>
<tr id="row4940853114219"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p13940185310423"><a name="p13940185310423"></a><a name="p13940185310423"></a>-gd &lt;index&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p1194095374213"><a name="p1194095374213"></a><a name="p1194095374213"></a>获取第index个dns server的信息。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p694025334210"><a name="p694025334210"></a><a name="p694025334210"></a>index,0或者1。</p>
</td>
</tr>
<tr id="row196815382432"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p14681238154317"><a name="p14681238154317"></a><a name="p14681238154317"></a>-sd &lt;dns_ip&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p4681038144316"><a name="p4681038144316"></a><a name="p4681038144316"></a>设置主dns server的ip。</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p4681173884313"><a name="p4681173884313"></a><a name="p4681173884313"></a>dns的ip地址。</p>
</td>
</tr>
</tbody>
</table>
## 使用指南<a name="section15935131220717"></a>
## 使用指南<a name="section04"></a>
dhclient eth0
dhclient -x eth0
dhclient -gb eth0
dhclient -sv MFSI
dhclient -gv
dhclient -gd 0
dhclient -sd 8.8.8.8
## 使用实例<a name="section79281818476"></a>
![](figure/zh-cn_image_0000001179848731.png)
## 输出说明<a name="section12742311179"></a>
**表 2** 输出说明
<a name="table487mcpsimp"></a>
<table><thead align="left"><tr id="row492mcpsimp"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p494mcpsimp"><a name="p494mcpsimp"></a><a name="p494mcpsimp"></a>输出</p>
</th>
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p496mcpsimp"><a name="p496mcpsimp"></a><a name="p496mcpsimp"></a>说明</p>
</th>
</tr>
</thead>
<tbody><tr id="row502mcpsimp"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p583513382179"><a name="p583513382179"></a><a name="p583513382179"></a>dhclient: set vendor info [MFSI] success</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p19833143819174"><a name="p19833143819174"></a><a name="p19833143819174"></a>设置厂商信息MFSI信息成功。</p>
</td>
</tr>
<tr id="row1990234224612"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p3902144294612"><a name="p3902144294612"></a><a name="p3902144294612"></a>dns[0]: 192.168.1.100</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p13903144284610"><a name="p13903144284610"></a><a name="p13903144284610"></a>dns server ip地址为192.168.1.100。</p>
</td>
</tr>
</tbody>
</table>
## 使用实例<a name="section05"></a>
```shell
OHOS:/$ dhclient eth0
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 42:da:81:bc:58:94 MTU:1500 Running Default Link UP
OHOS:/$
OHOS:/$ dhclient -x eth0
NetifStatusCallback(eth0): nsc event: 0xf0
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:0.0.0.0 netmask:0.0.0.0 gateway:0.0.0.0
HWaddr 42:da:81:bc:58:94 MTU:1500 Running Default Link UP
```
## 输出说明<a name="section06"></a>
无。
\ No newline at end of file
# dns<a name="ZH-CN_TOPIC_0000001179965857"></a>
- [命令功能](#section997513673713)
- [命令格式](#section146015943711)
- [参数说明](#section5732111163716)
- [使用指南](#section15642141417371)
- [使用实例](#section1995841617370)
- [输出说明](#section1114210258917)
## 命令功能<a name="section997513673713"></a>
命令用于查看和设置单板dns服务器地址。
## 命令格式<a name="section146015943711"></a>
dns <_1-2_\> <_IP_\>
dns _-a_
## 参数说明<a name="section5732111163716"></a>
**表 1** 参数说明
<a name="table1942mcpsimp"></a>
<table><thead align="left"><tr id="row1948mcpsimp"><th class="cellrowborder" valign="top" width="20.79%" id="mcps1.2.4.1.1"><p id="p1950mcpsimp"><a name="p1950mcpsimp"></a><a name="p1950mcpsimp"></a>参数</p>
</th>
<th class="cellrowborder" valign="top" width="52.480000000000004%" id="mcps1.2.4.1.2"><p id="p1952mcpsimp"><a name="p1952mcpsimp"></a><a name="p1952mcpsimp"></a>参数说明</p>
</th>
<th class="cellrowborder" valign="top" width="26.729999999999997%" id="mcps1.2.4.1.3"><p id="p1954mcpsimp"><a name="p1954mcpsimp"></a><a name="p1954mcpsimp"></a>取值范围</p>
</th>
</tr>
</thead>
<tbody><tr id="row1955mcpsimp"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.2.4.1.1 "><p id="p1957mcpsimp"><a name="p1957mcpsimp"></a><a name="p1957mcpsimp"></a>&lt;1-2&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="52.480000000000004%" headers="mcps1.2.4.1.2 "><p id="p1959mcpsimp"><a name="p1959mcpsimp"></a><a name="p1959mcpsimp"></a>选择设置第一个还是第二个DNS服务器。</p>
</td>
<td class="cellrowborder" valign="top" width="26.729999999999997%" headers="mcps1.2.4.1.3 "><p id="p1961mcpsimp"><a name="p1961mcpsimp"></a><a name="p1961mcpsimp"></a>1~2</p>
</td>
</tr>
<tr id="row1962mcpsimp"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.2.4.1.1 "><p id="p1964mcpsimp"><a name="p1964mcpsimp"></a><a name="p1964mcpsimp"></a>&lt;IP&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="52.480000000000004%" headers="mcps1.2.4.1.2 "><p id="p1966mcpsimp"><a name="p1966mcpsimp"></a><a name="p1966mcpsimp"></a>服务器IP地址。</p>
</td>
<td class="cellrowborder" valign="top" width="26.729999999999997%" headers="mcps1.2.4.1.3 "><p id="entry1967mcpsimpp0"><a name="entry1967mcpsimpp0"></a><a name="entry1967mcpsimpp0"></a>N/A</p>
</td>
</tr>
<tr id="row1968mcpsimp"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.2.4.1.1 "><p id="p1970mcpsimp"><a name="p1970mcpsimp"></a><a name="p1970mcpsimp"></a>-a</p>
</td>
<td class="cellrowborder" valign="top" width="52.480000000000004%" headers="mcps1.2.4.1.2 "><p id="p1972mcpsimp"><a name="p1972mcpsimp"></a><a name="p1972mcpsimp"></a>显示当前设置情况。</p>
</td>
<td class="cellrowborder" valign="top" width="26.729999999999997%" headers="mcps1.2.4.1.3 "><p id="entry1973mcpsimpp0"><a name="entry1973mcpsimpp0"></a><a name="entry1973mcpsimpp0"></a>N/A</p>
</td>
</tr>
</tbody>
</table>
## 使用指南<a name="section15642141417371"></a>
无。
## 使用实例<a name="section1995841617370"></a>
举例:
1. 检查当前DNS设置。
2. 设置第二个DNS服务器IP。
3. 检查DNS设置是否成功。
## 输出说明<a name="section1114210258917"></a>
1. 检查当前DNS设置:
```
OHOS # dns -a
dns1: 192.168.1.10
dns2: 0.0.0.0
```
2. 设置第二个DNS服务器IP:
```
OHOS # dns 2 192.168.1.2
```
3. 检查DNS设置是否成功:
```
OHOS # dns -a
dns1: 192.168.1.10
dns2: 192.168.1.2
```
......@@ -21,7 +21,7 @@ ipdebug
ipdebug打印信息如下:
```
```shell
OHOS # ipdebug
=================
|| Prefix List ||
......
......@@ -27,10 +27,24 @@ netstat
举例:输入netstat
**图 1** netstat 打印信息<a name="fig51865585412"></a>
![](figure/Snipaste_2021-01-26_10-38-58-25.png)
**示例 1** netstat 打印信息
```shell
OHOS # netstat
========== total sockets 128 ====== unused sockets 119 ==========
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.1.10:578 192.168.1.3:2049 ESTABLISHED
tcp 0 0 192.168.1.10:58653 0.0.0.0:0 LISTEN
tcp 0 0 192.168.1.10:58652 0.0.0.0:0 LISTEN
tcp 0 0 192.168.1.10:58651 0.0.0.0:0 LISTEN
Proto Recv-Q Send-Q Local Address Foreign Address
udp 0 0 127.0.0.1:62177 127.0.0.1:62178
udp 0 0 0.0.0.0:5684 0.0.0.0:0
udp 0 0 127.0.0.1:62179 127.0.0.1:62180
udp 0 0 127.0.0.1:62180 127.0.0.1:62179
udp 0 0 127.0.0.1:62178 127.0.0.1:62177
```
## 输出说明<a name="section1357015107117"></a>
......
......@@ -60,6 +60,10 @@ telnet \[_on | off_\]
## 输出说明<a name="section11846624191310"></a>
**图 1** 输入 telnet on<a name="fig127221042155418"></a>
![](figure/输入-telnet-on.png "输入-telnet-on")
**示例 1** 输入 telnet on
```shell
OHOS # telnet on
OHOS # start telnet server successfully, waiting for connection.
```
......@@ -4,8 +4,6 @@
- **[dhclient](kernel-small-debug-shell-net-dhclient.md)**
- **[dns](kernel-small-debug-shell-net-dns.md)**
- **[ifconfig](kernel-small-debug-shell-net-ifconfig.md)**
- **[ipdebug](kernel-small-debug-shell-net-ipdebug.md)**
......@@ -22,4 +20,3 @@
- **[tftp](kernel-small-debug-shell-net-tftp.md)**
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册