diff --git a/zh-cn/device-dev/kernel/figure/Snipaste_2021-01-26_10-38-58-26.png b/zh-cn/device-dev/kernel/figure/Snipaste_2021-01-26_10-38-58-26.png deleted file mode 100644 index 2e52f5c4b1ed500cd7eb3ebf665e49d531e4bd41..0000000000000000000000000000000000000000 Binary files a/zh-cn/device-dev/kernel/figure/Snipaste_2021-01-26_10-38-58-26.png and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/umount\350\276\223\345\207\272\347\244\272\344\276\213.png" "b/zh-cn/device-dev/kernel/figure/umount\350\276\223\345\207\272\347\244\272\344\276\213.png" deleted file mode 100755 index 0696f82d77764ee6c2c1f3fc87c298ede5daa784..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/umount\350\276\223\345\207\272\347\244\272\344\276\213.png" and /dev/null differ diff --git a/zh-cn/device-dev/kernel/figure/zh-cn_image_0000001179967909.png b/zh-cn/device-dev/kernel/figure/zh-cn_image_0000001179967909.png deleted file mode 100644 index b46941568abb594e0aa8480a27a248afd9545bdc..0000000000000000000000000000000000000000 Binary files a/zh-cn/device-dev/kernel/figure/zh-cn_image_0000001179967909.png and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\344\273\245\344\270\211\347\247\215\346\226\271\345\274\217\346\230\276\347\244\272\345\206\205\345\255\230\344\275\277\347\224\250\346\203\205\345\206\265.png" "b/zh-cn/device-dev/kernel/figure/\344\273\245\344\270\211\347\247\215\346\226\271\345\274\217\346\230\276\347\244\272\345\206\205\345\255\230\344\275\277\347\224\250\346\203\205\345\206\265.png" deleted file mode 100755 index 04b9bfb50791497b0a0726310e797dd664469cba..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\344\273\245\344\270\211\347\247\215\346\226\271\345\274\217\346\230\276\347\244\272\345\206\205\345\255\230\344\275\277\347\224\250\346\203\205\345\206\265.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\344\277\241\345\217\267\345\217\221\351\200\201\345\244\261\350\264\245.png" "b/zh-cn/device-dev/kernel/figure/\344\277\241\345\217\267\345\217\221\351\200\201\345\244\261\350\264\245.png" deleted file mode 100755 index bbac94b4cedd784cf2affc0b7bed38f0ab2962a9..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\344\277\241\345\217\267\345\217\221\351\200\201\345\244\261\350\264\245.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\344\277\241\345\217\267\345\217\221\351\200\201\347\273\223\346\236\234\345\233\276.png" "b/zh-cn/device-dev/kernel/figure/\344\277\241\345\217\267\345\217\221\351\200\201\347\273\223\346\236\234\345\233\276.png" deleted file mode 100755 index 86c14dc614b20edd875632212e3f26b689924c88..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\344\277\241\345\217\267\345\217\221\351\200\201\347\273\223\346\236\234\345\233\276.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\344\277\256\346\224\271-hello-harmony-txt-\346\226\207\344\273\266\347\232\204uid\344\270\272100-gid\344\270\272200.png" "b/zh-cn/device-dev/kernel/figure/\344\277\256\346\224\271-hello-harmony-txt-\346\226\207\344\273\266\347\232\204uid\344\270\272100-gid\344\270\272200.png" deleted file mode 100755 index 09325296f8439d97c33767045f3d6adbc316d506..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\344\277\256\346\224\271-hello-harmony-txt-\346\226\207\344\273\266\347\232\204uid\344\270\272100-gid\344\270\272200.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\344\277\256\346\224\271-hello-harmony-txt-\346\226\207\344\273\266\347\232\204\346\235\203\351\231\220\344\270\272666.png" "b/zh-cn/device-dev/kernel/figure/\344\277\256\346\224\271-hello-harmony-txt-\346\226\207\344\273\266\347\232\204\346\235\203\351\231\220\344\270\272666.png" deleted file mode 100755 index 97d249223841af716073bdc5c66d4d19dc078471..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\344\277\256\346\224\271-hello-harmony-txt-\346\226\207\344\273\266\347\232\204\346\235\203\351\231\220\344\270\272666.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\344\277\256\346\224\271-hello-harmony-txt-\346\226\207\344\273\266\347\232\204\347\276\244\347\273\204\344\270\272100.png" "b/zh-cn/device-dev/kernel/figure/\344\277\256\346\224\271-hello-harmony-txt-\346\226\207\344\273\266\347\232\204\347\276\244\347\273\204\344\270\272100.png" deleted file mode 100755 index 3875d6a92e675a216d461f77885af51fc33ff7cc..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\344\277\256\346\224\271-hello-harmony-txt-\346\226\207\344\273\266\347\232\204\347\276\244\347\273\204\344\270\272100.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\345\210\233\345\273\272-share-\347\233\256\345\275\225.png" "b/zh-cn/device-dev/kernel/figure/\345\210\233\345\273\272-share-\347\233\256\345\275\225.png" deleted file mode 100755 index cc4564a075f63d3f95fba9d747a70ea203a1348c..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\345\210\233\345\273\272-share-\347\233\256\345\275\225.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\345\210\233\345\273\272\344\270\200\344\270\252\345\220\215\344\270\272-file-c-\347\232\204\346\226\207\344\273\266.png" "b/zh-cn/device-dev/kernel/figure/\345\210\233\345\273\272\344\270\200\344\270\252\345\220\215\344\270\272-file-c-\347\232\204\346\226\207\344\273\266.png" deleted file mode 100755 index a030a27f42db85d9dcd01eed586310261e682a9a..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\345\210\233\345\273\272\344\270\200\344\270\252\345\220\215\344\270\272-file-c-\347\232\204\346\226\207\344\273\266.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\345\210\240\351\231\244\344\270\200\344\270\252\345\220\215\344\270\272-dir-\347\232\204\347\233\256\345\275\225.png" "b/zh-cn/device-dev/kernel/figure/\345\210\240\351\231\244\344\270\200\344\270\252\345\220\215\344\270\272-dir-\347\232\204\347\233\256\345\275\225.png" deleted file mode 100755 index ae2df6f3a9b19b467ddf5c17ffde90ed115e2a23..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\345\210\240\351\231\244\344\270\200\344\270\252\345\220\215\344\270\272-dir-\347\232\204\347\233\256\345\275\225.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\345\217\221\351\200\201\344\277\241\345\217\267\347\273\231\346\214\207\345\256\232\350\277\233\347\250\213.png" "b/zh-cn/device-dev/kernel/figure/\345\217\221\351\200\201\344\277\241\345\217\267\347\273\231\346\214\207\345\256\232\350\277\233\347\250\213.png" deleted file mode 100755 index d6d610c3206ee28dd5e4e3d53cac87f455bd8a2b..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\345\217\221\351\200\201\344\277\241\345\217\267\347\273\231\346\214\207\345\256\232\350\277\233\347\250\213.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\346\214\211\346\214\207\345\256\232\346\240\274\345\274\217\346\211\223\345\215\260\347\263\273\347\273\237\346\227\245\346\234\237.png" "b/zh-cn/device-dev/kernel/figure/\346\214\211\346\214\207\345\256\232\346\240\274\345\274\217\346\211\223\345\215\260\347\263\273\347\273\237\346\227\245\346\234\237.png" deleted file mode 100755 index 51508faa738519f47c0670f113b1f0f8cead31f8..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\346\214\211\346\214\207\345\256\232\346\240\274\345\274\217\346\211\223\345\215\260\347\263\273\347\273\237\346\227\245\346\234\237.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\346\230\276\347\244\272\347\273\223\346\236\234\345\246\202\344\270\213-24.png" "b/zh-cn/device-dev/kernel/figure/\346\230\276\347\244\272\347\273\223\346\236\234\345\246\202\344\270\213-24.png" deleted file mode 100644 index 91d1d9264778c46ca6b1986470dc6fdc3d881ea7..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\346\230\276\347\244\272\347\273\223\346\236\234\345\246\202\344\270\213-24.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\346\237\245\347\234\213\345\275\223\345\211\215\347\263\273\347\273\237\350\267\257\345\276\204\344\270\213\347\232\204\347\233\256\345\275\225-\346\230\276\347\244\272\347\232\204\345\206\205\345\256\271\345\246\202\344\270\213.png" "b/zh-cn/device-dev/kernel/figure/\346\237\245\347\234\213\345\275\223\345\211\215\347\263\273\347\273\237\350\267\257\345\276\204\344\270\213\347\232\204\347\233\256\345\275\225-\346\230\276\347\244\272\347\232\204\345\206\205\345\256\271\345\246\202\344\270\213.png" deleted file mode 100755 index b8a236bdc184363d0463a7eaf5a4f054421e531c..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\346\237\245\347\234\213\345\275\223\345\211\215\347\263\273\347\273\237\350\267\257\345\276\204\344\270\213\347\232\204\347\233\256\345\275\225-\346\230\276\347\244\272\347\232\204\345\206\205\345\256\271\345\246\202\344\270\213.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\346\237\245\347\234\213\350\277\233\347\250\213PID.png" "b/zh-cn/device-dev/kernel/figure/\346\237\245\347\234\213\350\277\233\347\250\213PID.png" deleted file mode 100755 index 8fb629e38738641a958cba848c37a522ee8b893b..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\346\237\245\347\234\213\350\277\233\347\250\213PID.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\347\224\250-rm--r-\345\210\240\351\231\244\347\233\256\345\275\225-sd.png" "b/zh-cn/device-dev/kernel/figure/\347\224\250-rm--r-\345\210\240\351\231\244\347\233\256\345\275\225-sd.png" deleted file mode 100755 index 61eb6697739122f4dc74a0a583aa2edd00f9e3a2..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\347\224\250-rm--r-\345\210\240\351\231\244\347\233\256\345\275\225-sd.png" and /dev/null differ diff --git "a/zh-cn/device-dev/kernel/figure/\347\224\250-rm-\345\221\275\344\273\244\345\210\240\351\231\244\346\226\207\344\273\266-log1-txt.png" "b/zh-cn/device-dev/kernel/figure/\347\224\250-rm-\345\221\275\344\273\244\345\210\240\351\231\244\346\226\207\344\273\266-log1-txt.png" deleted file mode 100755 index dfe025c125714a7b7f3374b8323b785b59706c8d..0000000000000000000000000000000000000000 Binary files "a/zh-cn/device-dev/kernel/figure/\347\224\250-rm-\345\221\275\344\273\244\345\210\240\351\231\244\346\226\207\344\273\266-log1-txt.png" and /dev/null differ diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-date.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-date.md index aec953c85cfc6d6d66be9eeddde7e41f22c1d30d..a7359f79e99f11111345c789a85fcef71deefe56 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-date.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-date.md @@ -9,7 +9,7 @@ ## 命令功能 -date命令用于查询及设置系统日期和时间。 +date命令用于查询系统日期和时间。 ## 命令格式 @@ -19,22 +19,19 @@ date --help date +\[_Format_\] -date -s_ _\[_YY/MM/DD_\] - -date_ _-s_ _\[_hh:mm:ss_\]__ - -date -r \[_Filename_\] +date -u ## 参数说明 **表 1** 参数说明 + - @@ -42,35 +39,21 @@ date -r \[_Filename_\] - - - - - - - - - - - - - @@ -78,17 +61,21 @@ date -r \[_Filename_\] ## 使用指南 -- date参数缺省时,默认显示当前系统日期和时间。 -- --help、+Format、-s、-r不能混合使用。 +- date参数缺省时,默认显示系统UTC日期和时间。 +- --help、+Format、-u不能混合使用。 +- 目前命令不支持设置时间和日期。 ## 使用实例 举例: -输入date +%Y--%m--%d。 +输入 date +%Y--%m--%d ## 输出说明 -**图 1** 按指定格式打印系统日期 -![](figure/按指定格式打印系统日期.png "按指定格式打印系统日期") +**示例 1** 按指定格式打印系统日期 +```shell +OHOS:/$ date +%Y--%m--%d +1970--01--01 +``` \ No newline at end of file diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-free.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-free.md index 7530dfc1fc39729c4519002995fef25e3c929610..d37eb4f96c804d4e083dee34cafed0bf3feeb23d 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-free.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-free.md @@ -1,21 +1,21 @@ # free -- [命令功能](#section175151514841) -- [命令格式](#section8488721749) -- [参数说明](#section27272181949) -- [使用指南](#section148661259410) -- [使用实例](#section68081530242) -- [输出说明](#section171235517543) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 -free命令可显示系统内存的使用情况,同时显示系统的text段、data段、rodata段、bss段大小。 +free命令可显示系统内存的使用情况。 -## 命令格式 +## 命令格式 -free \[_-k | -m_\] +free \[_-b | -k | -m | -g | -t_\] -## 参数说明 +## 参数说明 **表 1** 参数说明 @@ -35,6 +35,20 @@ free \[_-k | -m_\] + + + + + + + + + + + + + + + +

参数

参数说明

取值范围

+

取值范围

使用帮助。

N/A

+

N/A

+Format

根据Format格式打印日期和时间。

--help中列出的占位符。

-

-s YY/MM/DD

-

设置系统时间,用“/”分割的年月日。

-

>= 1970/01/01

-

-s hh:mm:ss

-

设置系统时间,用“:”分割的时分秒。

-

N/A

+

--help中列出的占位符。

-r Filename

+

-u

查询Filename文件的修改时间。

+

显示UTC,而不是当前时区

N/A

+

N/A

N/A

--help/-h

+

查看free命令支持的参数列表。

+

N/A

+

-b

+

以Byte为单位显示。

+

N/A

+

-k

以KiB为单位显示。

@@ -49,23 +63,54 @@ free \[_-k | -m_\]

N/A

-g

+

以GiB为单位显示。

+

N/A

+

-t

+

以TiB为单位显示。

+

N/A

+
-## 使用指南 +## 使用指南 无。 -## 使用实例 +## 使用实例 -举例:分别输入free、free -k、free -m. +举例:分别输入free、free -k、free -m。 -## 输出说明 +## 输出说明 -**图 1** 以三种方式显示内存使用情况 -![](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** 输出元素说明 - - - - - - - - - - - - -

输出

@@ -89,31 +134,15 @@ free \[_-k | -m_\]

表示未被分配的内存大小。

heap

-

表示已分配堆大小。

-

text

+

shared

表示代码段大小。

+

表示共享内存大小。

data

+

buffers

表示数据段大小。

-

rodata

-

表示只读数据段大小。

-

bss

-

表示未初始化全局变量占用内存大小。

+

表示缓冲区内存大小。

- diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-help.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-help.md index 6e6a6d8899d8b19e3bc2e7e7d2b745c1d0ef01b6..5a1b32501a81508183a6c15bf87426333a100e6e 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-help.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-help.md @@ -1,46 +1,64 @@ # help -- [命令功能](#section991211345413) -- [命令格式](#section19103204016410) -- [参数说明](#section1533416233432) -- [使用指南](#section4156445417) -- [使用实例](#section12776124712417) -- [输出说明](#section092662412544) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 -help命令用于显示当前操作系统内所有操作指令。 +help命令用于显示当前操作系统内所有操作指令和部分toybox指令。 -## 命令格式 +## 命令格式 help -## 参数说明 +## 参数说明 无。 -## 使用指南 +## 使用指南 help用于显示当前操作系统内所有操作指令。 -## 使用实例 +## 使用实例 -举例:输入help +举例:输入help。 -## 输出说明 +## 输出说明 -查看系统内所有操作指令。 +**示例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 ``` + + diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-kill.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-kill.md index 0d8323058c7be24d7836796cfdfc4da7462daffd..2326ebaa81fb70d01eba365f4253566754aa2fe2 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-kill.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-kill.md @@ -1,21 +1,21 @@ # kill -- [命令功能](#section366714216619) -- [命令格式](#section8833164614615) -- [参数说明](#section12809111019453) -- [使用指南](#section15935131220717) -- [使用实例](#section79281818476) -- [输出说明](#section12742311179) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 命令用于发送特定信号给指定进程。 -## 命令格式 +## 命令格式 -kill \[_signo_ | _-signo_\] \[_pid_\] +kill \[-l \[_signo_\] | _-s signo_ | _-signo_\] _pid..._ -## 参数说明 +## 参数说明 **表 1** 参数说明 @@ -28,7 +28,28 @@ kill \[_signo_ | _-signo_\] \[_pid_\] -

signo

+

--help

+ +

查看kill命令支持的参数列表

+ +

N/A

+ + +

-l

+ +

列出信号名称和编号。

+ +

N/A

+ + +

-s

+ +

发送信号

+ +

N/A

+ + +

signo

信号ID。

@@ -48,35 +69,86 @@ kill \[_signo_ | _-signo_\] \[_pid_\] >![](../public_sys-resources/icon-notice.gif) **须知:** >signo有效范围为\[0,64\],建议取值范围为\[1,30\],其余为保留内容。 -## 使用指南 +## 使用指南 必须指定发送的信号编号及进程号。 进程编号取值范围根据系统配置变化,例如系统最大支持pid为256,则取值范围缩小为\[1-256\]。 -## 使用实例 - -1. 查看当前进程列表,查看需要杀死的进程PID(7)。 +## 使用实例 + +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 +``` + +## 输出说明 -**图 1** 查看进程PID -![](figure/查看进程PID.png "查看进程PID") - -2. 发送信号14(SIGALRM默认行为为进程终止)给7号进程**helloworld\_d**(用户态进程):**kill 14 7**(kill -14 7效果相同),并查看当前进程列表,7号进程已终止。 - -**图 2** 信号发送结果图 -![](figure/信号发送结果图.png "信号发送结果图") +发送成功或失败输出结果如下。 -## 输出说明 +**示例 1** 发送信号给指定进程 -发送成功或失败输出结果如下。 +```shell +OHOS:/$ kill -s 9 42 +OHOS:/$ +[1] + Killed ./nfs/test_demo +``` -**图 3** 发送信号给指定进程 -![](figure/发送信号给指定进程.png "发送信号给指定进程") +信号发送成功会显示的提示进程已被杀死。 -信号发送会显示发送记录,未报错表示信号发送成功。 +**示例 2** 信号发送失败 -**图 4** 信号发送失败 -![](figure/信号发送失败.png "信号发送失败") +```shell +OHOS:/$ kill -100 31 +kill: Unknown signal '(null)' +``` -信号发送失败,上图所示原因为信号发送命令参数无效,请排查信号编号及进程编号是否无效。 +信号发送失败,示例2所示原因为信号发送命令参数无效,请排查信号编号及进程编号是否有效。 diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-reboot.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-reboot.md new file mode 100644 index 0000000000000000000000000000000000000000..9ee15a22d155f808bed4e3d032e2fccfe82adeef --- /dev/null +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-reboot.md @@ -0,0 +1,33 @@ +# reboot + +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) + +## 命令功能 + +reboot命令用于重启设备。 + +## 命令格式 + +reboot + +## 参数说明 + +无。 + +## 使用指南 + +reboot命令输入后,设备会立刻重启。 + +## 使用实例 + +reboot + +## 输出说明 + +无。 + diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-reset.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-reset.md index 47c0170574cf4c6898dd4371909fc00f4d2c0e00..c359250aa26ba5a55f99680656129a7e758cea1c 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-reset.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-reset.md @@ -21,7 +21,7 @@ reset ## 使用指南 -reset命令输入后,设备会在立刻重启。 +reset命令输入后,设备会立刻重启。 ## 使用实例 diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-top.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-top.md new file mode 100644 index 0000000000000000000000000000000000000000..514f1594cfad74af7002e691e40aaa350295c509 --- /dev/null +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-top.md @@ -0,0 +1,176 @@ +# top + +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) + +## 命令功能 + +top命令用于查询进程及线程信息。 + +## 命令格式 + +top \[_-a_\] + +## 参数说明 + +**表 1** 参数说明 + + + + + + + + + + + + + + + + +

参数

+

参数说明

+

取值范围

+

--help

+

查看top命令支持的参数列表。

+

N/A

+

-a

+

显示更详细的信息。

+

N/A

+
+ +## 使用指南 + +- 参数缺省时默认打印部分任务信息。 + +## 使用实例 + +举例:输入top + +## 输出说明 + +**示例 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** 输出元素说明 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

输出

+

说明

+

PID

+

进程ID。

+

PPID

+

父进程ID。

+

PGID

+

进程组ID。

+

UID

+

用户ID。

+

Status

+

任务当前的状态。

+

CPUUSE10s

+

10秒内CPU使用率。

+

PName

+

进程名。

+

TID

+

任务ID。

+

StackSize

+

任务堆栈的大小。

+

WaterLine

+

栈使用的峰值。

+

MEMUSE

+

内存使用量。

+

TaskName

+

任务名。

+
diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-uname.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-uname.md index 7ee5b951b3fc35988e55fdb19e4b6238cd10ce8b..da30027e1a1eb76e9e749552d164240953f39c2e 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-uname.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd-uname.md @@ -1,72 +1,93 @@ # uname -- [命令功能](#section107697383115) -- [命令格式](#section162824341116) -- [使用指南](#section2652124861114) -- [使用实例](#section0107995132) -- [输出说明](#section1215113245511) +- [命令功能](#section01) +- [命令格式](#section02) +- [使用指南](#section03) +- [使用实例](#section04) +- [输出说明](#section05) -## 命令功能 +## 命令功能 uname命令用于显示当前操作系统的名称,版本创建时间,系统名称,版本信息等。 -## 命令格式 +## 命令格式 -uname \[_-a | -s | -t | -v | --help_\] +uname \[_-a | -s | -r | -m | -n | -v --help_\] **表 1** 参数说明 - - @@ -45,16 +45,25 @@ chmod \[_mode_\] \[_pathname_\]

参数

+ - - - - - - - - - - - - - + + + + + +

参数

参数说明

+

参数说明

无参数

+

--help

默认显示操作系统名称。

+

显示uname指令格式提示。

-a

+

无参数

显示全部信息。

+

默认显示操作系统名称。

-t

+

-a

显示版本创建的时间。

+

显示全部信息。

-s

+

-s

显示操作系统名称。

+

显示操作系统名称。

-v

+

-r

显示版本信息。

+

显示内核发行版本。

--help

+

-m

显示uname指令格式提示。

+

显示系统架构名称。

+

-n

+

显示主机的网络域名称。

+

-v

+

显示版本信息。

-## 使用指南 +## 使用指南 + +uname用于显示当前操作系统名称。语法uname -a | -s | -r | -m | -n | -v 描述uname 命令将正在使用的操作系统名写到标准输出中。 -uname用于显示当前操作系统名称。语法uname -a | -t| -s| -v 描述uname 命令将正在使用的操作系统名写到标准输出中,这几个参数不能混合使用。 +## 使用实例 -## 使用实例 +举例:输入uname -a 、uname -ms -举例:输入uname -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:/$ +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd.md index dac940d4b3da90531c04dffbbb578c3dd232b304..0345b3c4c326460e6ebf3e1e518d83b32142237d 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-cmd.md @@ -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)** - - diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chgrp.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chgrp.md index f3daf2a86cda18702f9c46c8da82b9e7b3f33686..22aafd1c9d20d14dffb05806d608798fc18678b0 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chgrp.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chgrp.md @@ -1,25 +1,26 @@ # chgrp -- [命令功能](#section6103119161418) -- [命令格式](#section186958132141) -- [参数说明](#section81796174141) -- [使用指南](#section14330152417140) -- [使用实例](#section951823119149) -- [输出说明](#section14271133125715) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 chgrp用于修改文件的群组。 -## 命令格式 +## 命令格式 chgrp \[_group_\] \[_pathname_\] -## 参数说明 +## 参数说明 **表 1** 参数说明 +

参数

参数说明

@@ -45,16 +46,24 @@ chgrp \[_group_\] \[_pathname_\]
-## 使用指南 +## 使用指南 -在需要修改的文件名前加上文件群组值就可以修改该文件的所属组。 +- 在需要修改的文件名前加上文件群组值就可以修改该文件的所属组。 +- fatfs文件系统不支持修改用户组id。 -## 使用实例 +## 使用实例 -举例:chgrp 100 hello-harmony.txt +举例:chgrp 100 testfile -## 输出说明 +## 输出说明 -**图 1** 修改 hello-harmony.txt 文件的群组为100 -![](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$ +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chmod.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chmod.md index 8de5a066f246c26cd7691da5ee3a7438e597343a..d3cc5ebd5a39448fa4a6be81ed4f39f190d436a6 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chmod.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chmod.md @@ -1,21 +1,21 @@ # chmod -- [命令功能](#section13992936121418) -- [命令格式](#section63342439147) -- [参数说明](#section894414671411) -- [使用指南](#section182415221419) -- [使用实例](#section8518195718147) -- [输出说明](#section127391818158) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 chmod用于修改文件操作权限。 -## 命令格式 +## 命令格式 -chmod \[_mode_\] \[_pathname_\] +chmod \[_mode_\] \[_filename_\] -## 参数说明 +## 参数说明 **表 1** 参数说明 @@ -35,7 +35,7 @@ chmod \[_mode_\] \[_pathname_\]

[0,777]

pathname

+

filename

文件路径。

-## 使用指南 +## 使用指南 -在需要修改的文件名前加上文件权限值就可以修改该文件的权限值。 +- 在需要修改的文件名前加上文件权限值就可以修改该文件的权限值。 +- fatfs文件系统所有创建的文件和挂载节点的权限属性保持一致,目前节点的权限只有用户读写权限,group和others权限不生效;且只允许修改用户读写权限,读写权限只有rw和ro两种。其他文件系统无限制。 -## 使用实例 +## 使用实例 -举例:chmod 666 hello-harmony.txt +举例:chmod 644 hello-harmony.txt ; chmod 777 hello-harmony.txt -## 输出说明 +## 输出说明 -**图 1** 修改 hello-harmony.txt 文件的权限为666 -![](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 +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chown.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chown.md index f2a6f3e565219bd015814a52cdaf0ddf16561140..6a68dafbedc0def51dd7bb63e1fda9a4c750fbe4 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chown.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-chown.md @@ -1,21 +1,21 @@ # chown -- [命令功能](#section247414691513) -- [命令格式](#section14773151018159) -- [参数说明](#section598731391517) -- [使用指南](#section16524152071510) -- [使用实例](#section17901152561510) -- [输出说明](#section15513163115816) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 -chmod用于将指定文件的拥有者改为指定的用户或组。 +chown用于修改指定文件的拥有者。 -## 命令格式 +## 命令格式 -chown \[_owner_\] \[_group_\] \[_pathname_\] +chown \[_owner_\] \[_pathname_\] -## 参数说明 +## 参数说明 **表 1** 参数说明 @@ -35,14 +35,6 @@ chown \[_owner_\] \[_group_\] \[_pathname_\]

[0,0xFFFFFFFF]

-

group

- -

文件群组。

- -

1、为空。

-

2、[0,0xFFFFFFFF]

- -

pathname

文件路径。

@@ -53,18 +45,23 @@ chown \[_owner_\] \[_group_\] \[_pathname_\] -## 使用指南 +## 使用指南 -- 在需要修改的文件名前加上文件拥有者和文件群组就可以分别修改该文件的拥有者和群组。 -- 当owner或group值为-1时则表示对应的owner或group不修改。 -- group参数可以为空。 +修改文件的所有者,目前fatfs不支持修改。 -## 使用实例 +## 使用实例 -举例:chown 100 200 hello-harmony.txt +举例:chown 100 testfile -## 输出说明 +## 输出说明 -**图 1** 修改 hello-harmony.txt 文件的uid为100,gid为200 -![](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 +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-cp.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-cp.md index 7922befb78cd1b16a16a6e2610183cf1ed021c18..dd3cb63667b9b7066d8354487d91343058966718 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-cp.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-cp.md @@ -1,68 +1,89 @@ # cp -- [命令功能](#section6841203041513) -- [命令格式](#section24286359150) -- [参数说明](#section558617385152) -- [使用指南](#section16128156162) -- [使用实例](#section19354171211618) -- [输出说明](#section16754183195914) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 拷贝文件,创建一份副本。 -## 命令格式 +## 命令格式 + +cp --help cp \[_SOURCEFILE_\] \[_DESTFILE_\] -## 参数说明 +## 参数说明 **表 1** 参数说明 - - - + + + + - - - -

参数

参数说明

+

参数说明

取值范围

+

取值范围

SOURCEFILE

+

--help

+

使用帮助。

+

N/A

+

SOURCEFILE

源文件路径。

+

源文件路径。

目前只支持文件,不支持目录。

+

目前只支持文件,不支持目录;支持多文件同时拷贝。

DESTFILE

目的文件路径。

+

目的文件路径。

支持目录以及文件。

+

支持目录以及文件。

-## 使用指南 +## 使用指南 - 同一路径下,源文件与目的文件不能重名。 - 源文件必须存在,且不为目录。 - 源文件路径支持“\*”和“?”通配符,“\*”代表任意多个字符,“?”代表任意单个字符。目的路径不支持通配符。当源路径可匹配多个文件时,目的路径必须为目录。 - 目的路径为目录时,该目录必须存在。此时目的文件以源文件命名。 - 目的路径为文件时,所在目录必须存在。此时拷贝文件的同时为副本重命名。 -- 目前不支持多文件拷贝。参数大于2个时,只对前2个参数进行操作。 - 目的文件不存在时创建新文件,已存在则覆盖。 -拷贝系统重要资源时,会对系统造成死机等重大未知影响,如用于拷贝/dev/uartdev-0 文件时,会产生系统卡死现象。 +> ![](../public_sys-resources/icon-notice.gif) **须知:** +> +> 拷贝系统重要资源时,会对系统造成死机等重大未知影响,如用于拷贝/dev/uartdev-1 文件时,会产生系统卡死现象。 -## 使用实例 +## 使用实例 -举例:cp hello-harmony.txt ./tmp/ +举例:cp hello-OHOS.txt hello-harmony.txt ./tmp/ -## 输出说明 +## 输出说明 -**图 1** 显示结果如下 -![](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* +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-du.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-du.md new file mode 100644 index 0000000000000000000000000000000000000000..57e9708b44923c587a219905085b25c16a8be4be --- /dev/null +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-du.md @@ -0,0 +1,92 @@ +# du + +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) + +## 命令功能 + +du显示指定的文件所占用的磁盘空间。 + +## 命令格式 + +du \[_-kKmh_\] \[_file..._\] + +## 参数说明 + +**表 1** 参数说明 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

参数

+

参数说明

+

取值范围

+

--help

+

查看du命令支持的参数列表。

+

N/A

+

-k

+

显示占用的块,每块1024bytes(默认)。

+

N/A

+

-K

+

显示占用的块,每块512bytes(posix)。

+

N/A

+

-m

+

兆字节为单位。

+

N/A

+

-h

+

以K,M,G为单位,提高信息的可读性(例如,1K 243M 2G)。

+

N/A

+

file

+

指定的需要统计的文件。

+

N/A

+
+ +## 使用指南 + +- 不支持统计目录的大小,只支持统计文件的大小。 +- file的内容既为文件名,不能包含其所在的目录。 + +## 使用实例 + +举例:du -h testfile + +## 输出说明 + +**示例 1** 显示结果如下 + +```shell +OHOS:/$ du -h testfile +1.8K testfile +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-ls.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-ls.md index ddba2404bd8e95c2c04063a7c1a1beedaf063c8e..a1fb4a932fdad4d230e664bd0f25a1fdf20e50d7 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-ls.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-ls.md @@ -1,23 +1,25 @@ # ls -- [命令功能](#section6538163771614) -- [命令格式](#section45881743111616) -- [参数说明](#section17528148171617) -- [使用指南](#section041212533166) -- [使用实例](#section986105716167) -- [输出说明](#section2036124918592) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 ls命令用来显示当前目录的内容。 -## 命令格式 +## 命令格式 -ls \[_path_\] +ls \[_-ACHLSZacdfhiklmnopqrstux1_\] \[_--color_\[_=auto_\]\] \[_directory..._\] -## 参数说明 +> **说明:** 系统启动过程中已经通过 alias 为 ls=toybox ls --color=auto 、ll = ls -alF 、 la=ls -A 和 l=ls -CF 赋能,使这几个命令的初始行为就和linux相同(详细效果见输出说明)。所以若要查看help列表,请输入'toybox ls --help'。 -**表 1** 参数说明 +## 参数说明 + +**表 1** 展示功能参数说明 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

参数

@@ -28,7 +30,105 @@ ls \[_path_\]

path

+

--help

+

查看ls命令支持的参数列表,使用方式。

+

N/A

+

-a

+

显示所有文件包括.hidden隐藏类型的文件。

+

N/A

+

-b

+

转义非图形字符。

+

N/A

+

-c

+

使用ctime作为文件的时间戳。"ls -lc"

+

N/A

+

-d

+

只显示path名称不显示path所包含的内容。

+

N/A

+

-i

+

显示文件的节点号。

+

N/A

+

-p

+

在path名称后放一个"/"。

+

N/A

+

-q

+

显示不可打印字符比如'?'。

+

N/A

+

-s

+

统计目录和其成员所占用的内存大小,单位为1024字节。

+

N/A

+

-u

+

以文件的最后访问时间为时间戳,配合 -l 一起使用。

+

N/A

+

-A

+

列出所有文件除了.和..

+

N/A

+

-H

+

跟随命令行符号链接。

+

N/A

+

-L

+

跟随符号链接。

+

N/A

+

-Z

+

安全上下文。

+

N/A

+

path

path为空时,显示当前目录的内容。

path为无效文件名时,显示失败,提示:

@@ -42,18 +142,177 @@ ls \[_path_\]
-## 使用指南 +**表2** 输出格式参数说明 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

参数

+

参数说明

+

取值范围

+

-1

+

每行列出一个文件。

+

N/A

+

-c

+

列,垂直排序。

+

N/A

+

-g

+

类似于 -l 但没有所有者。

+

N/A

+

-h

+

统计path目录下文件的总大小,单位为KiB。

+

N/A

+

-l

+

详细的显示path目录下文件的信息。

+

N/A

+

-m

+

文件之间添加逗号。

+

N/A

+

-n

+

类似 -l 数字格式显示uid/gid。

+

N/A

+

-o

+

类似 -l 但显示列表不包括组。

+

N/A

+

-x

+

列,水平排序。

+

N/A

+

-ll

+

文件的时间属性显示纳秒。

+

N/A

+

--color

+

彩色打印。

+

默认配置为:device=yellow symlink=turquoise/red dir=blue socket=purple files: exe=green suid=red suidfile=redback stickydir=greenback=auto means detect if output is a tty.

+
+ +**表3** 排序参数说明(默认为按首字母排序) + + + + + + + + + + + + + + + + + + + + + + + +

参数

+

参数说明

+

取值范围

+

-f

+

不排序。

+

N/A

+

-r

+

按首字母反向排序。

+

N/A

+

-t

+

按文件的最后修改时间排序,最近时间为排头。

+

N/A

+

-S

+

按文件大小来排序,大文件为排头。

+

N/A

+
+ +## 使用指南 - ls命令显示当前目录的内容。 -- ls可以显示文件的大小。 -- proc下ls无法统计文件大小,显示为0。 +- ll可以显示文件的大小。 +- proc下ll无法统计文件大小,显示为0。 +- dev、proc、无法统计文件时间信息。 + +> ![](../public_sys-resources/icon-notice.gif) **须知:** +> +> fatfs的文件节点信息继承其父节点,父节点号为0。故在hi3516dv300开发板上ls -i显示的文件节点号全为0。 + +## 使用实例 + +举例:输入ls、ll -## 使用实例 +## 输出说明 -举例:输入ls +**示例 1** ls命令查看当前路径下的内容 -## 输出说明 +```shell +OHOS:/$ ls +bin etc nfs sdcard system usr +dev lib proc storage userdata vendor +``` -**图 1** 查看当前系统路径下的目录,显示的内容如下 -![](figure/查看当前系统路径下的目录-显示的内容如下.png "查看当前系统路径下的目录-显示的内容如下") +**示例 2** ll命令查看当前路径下的内容 +```shell +OHOS:/$ ll +total 20 +drwxrwxrwx 1 0 0 2048 2021-11-21 17:52 bin/ +drwxr-xr-x 0 0 0 0 1970-01-01 00:00 dev/ +drwxrwxrwx 1 0 0 2048 2021-11-21 17:52 etc/ +drwxrwxrwx 1 0 0 2048 2021-11-21 17:52 lib/ +drwxrwxrwx 0 0 0 4096 2021-10-25 02:17 nfs/ +dr-xr-xr-x 0 0 0 0 1970-01-01 00:00 proc/ +drwxrwxrwx 1 0 0 4096 1979-12-31 00:00 sdcard/ +drwxrwxrwx 1 0 0 2048 2021-11-21 17:52 storage/ +drwxrwxrwx 1 0 0 2048 2021-11-21 17:52 system/ +drwxrwxrwx 1 0 0 2048 2021-11-21 17:52 userdata/ +drwxrwxrwx 1 0 0 2048 2021-11-21 17:52 usr/ +drwxrwxrwx 1 0 0 2048 2021-11-21 17:52 vendor/ +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mkdir.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mkdir.md index b8d551e7143dbcb51a080e461a930fe248bd7d10..1b8df8029dac557a54782fa0b97648917ce7dee9 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mkdir.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mkdir.md @@ -1,21 +1,21 @@ # mkdir -- [命令功能](#section1083613274175) -- [命令格式](#section820913118178) -- [参数说明](#section1256834121718) -- [使用指南](#section1294234115172) -- [使用实例](#section1113345211713) -- [输出说明](#section10142201012) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 mkdir命令用来创建一个目录。 -## 命令格式 +## 命令格式 -mkdir \[_directory_\] +mkdir \[_-vp_\] \[_-m mode_\] \[_dirname..._\] -## 参数说明 +## 参数说明 **表 1** 参数说明 @@ -28,7 +28,35 @@ mkdir \[_directory_\] -

directory

+

--help

+ +

查看mkdir命令支持的参数列表

+ +

N/A

+ + +

-m

+ +

设置即将创建目录的权限。

+ +

N/A

+ + +

-p

+ +

递归逐级创建父子目录。

+ +

N/A

+ + +

-v

+ +

打印创建目录过程中的详细信息。

+ +

N/A

+ + +

directory

需要创建的目录。

@@ -38,17 +66,60 @@ mkdir \[_directory_\] -## 使用指南 +## 使用指南 - mkdir后加所需要创建的目录名会在当前目录下创建目录。 - mkdir后加路径,再加上需要创建的目录名,即在指定目录下创建目录。 +- mkdir后加参数,提供目录权限定制,目录逐级创建等功能。 + +> ![](../public_sys-resources/icon-notice.gif) **须知:** +> +> fatfs文件系统所有创建的文件和其挂载节点的权限属性保持一致,目前节点的权限只有用户读写权限,group和others权限不生效, +> +> 且只有读写位可设置,有rw和ro两种,因此mkdir在附加-m参数时,创建的目录权限仅有777和555两种,可执行权限也不生效。 + +## 使用实例 + +举例: + +- mkdir testpath +- mkdir -m 777 testpath +- mkdir -pv testpath01/testpath02/testpath03 + +## 输出说明 + +**示例 1** 创建默认文件 -## 使用实例 +```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的目录 -## 输出说明 +```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 目录 -![](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/ +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mount.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mount.md index a2bebb1ea133d2ed9c0c998952fa1d1f5930f71d..43551e38c86887ec41fe25413626ffbeebafe999 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mount.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mount.md @@ -1,21 +1,21 @@ # mount -- [命令功能](#section11631837182) -- [命令格式](#section1697638111820) -- [参数说明](#section1650151221819) -- [使用指南](#section124541520171912) -- [使用实例](#section7424625171917) -- [输出说明](#section14757018116) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 mount命令用来将设备挂载到指定目录。 -## 命令格式 +## 命令格式 -mount <_device_\> <_path_\> <_name_\> \[_uid gid_\] +mount \[_-f_\] \[_-t TYPE_\] \[_-o OPTION,_\] \[\[_DEVICE_\] _DIR_\] -## 参数说明 +## 参数说明 **表 1** 参数说明 @@ -28,51 +28,71 @@ mount <_device_\> <_path_\> <_name_\> \[_uid gid_\] -

device

+

--help

-

要挂载的设备(格式为设备所在路径)。

+

查看mount命令支持的参数列表。

-

系统拥有的设备。

+

N/A

-

path

+

-f

-

指定目录。

-

用户必须具有指定目录中的执行(搜索)许可权。

+

佯装挂载动作(实际不做挂载)。

-

N/A

+

N/A

-

name

+

-t

-

文件系统的种类。

+

文件系统的种类。

-

vfat, yaffs, jffs, ramfs, nfs,procfs, romfs.

+

TYPE:vfat, yaffs, jffs, ramfs, nfs,procfs, romfs.

-

uid gid

+

-o

-

uid是指用户ID。

-

gid是指组ID。

-

可选参数,缺省值uid:0,gid:0。

+

挂载选项。

-

N/A

+

N/A

+ + +

DEVICE

+ +

要挂载的设备(格式为设备所在路径)。

+ +

系统拥有的设备。

+ + +

DIR

+ +

指定目录。

+

用户必须具有指定目录中的执行(搜索)许可权。

+ +

N/A

-## 使用指南 +## 使用指南 mount后加需要挂载的设备信息、指定目录以及设备文件格式,就能成功挂载文件系统到指定目录。 -## 使用实例 - -举例:mount /dev/mmcblk0p0 /bin1/vs/sd vfat +## 使用实例 -## 输出说明 +举例:mount -t nfs 192.168.1.3:/nfs nfs -将/dev/mmcblk0p0 挂载到/bin1/vs/sd目录 +## 输出说明 -![](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 +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mv.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mv.md new file mode 100644 index 0000000000000000000000000000000000000000..2c0dfaad23e1364e495fa55d7afd65c530e6ec6a --- /dev/null +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-mv.md @@ -0,0 +1,134 @@ +# mv + +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) + +## 命令功能 + +移动文件 + +## 命令格式 + +mv \[_-fivn_\] _SOURCE... DEST_ + +## 参数说明 + +**表 1** 参数说明 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

参数

+

参数说明

+

取值范围

+

--help

+

使用帮助。

+

N/A

+

-f

+

通过删除目标文件强制复制。

+

N/A

+

-i

+

若指定移动的源目录或文件与目标中目录或文件同名,则会先询问是否覆盖旧文件,输入 y 直接覆盖,输入 n 取消该操作。

+

N/A

+

-n

+

不要覆盖任何已存在的文件或目录。

+

N/A

+

-v

+

目前本参数toybox官方最新代码虽然支持,但同样也不生效。

+

N/A

+

SOURCE

+

源文件路径。

+

目前只支持文件,不支持目录;支持多文件同时移动。

+

DEST

+

目的文件路径。

+

支持目录以及文件。

+
+ +## 使用指南 + +- 源文件路径支持“\*”和“?”通配符,“\*”代表任意多个字符,“?”代表任意单个字符。目的路径不支持通配符。当源路径可匹配多个文件时,目的路径必须为目录。 +- 目的路径为目录时,该目录必须存在。此时目的文件以源文件命名。 +- 目的路径为文件时,所在目录必须存在。 +- 目的文件已存在则会覆盖。 + +## 使用实例 + +举例: + +mv -i test.txt testpath/ + +mv test?.txt testpath/ (移动 test3.txt testA.txt test_.txt) + +## 输出说明 + +**示例 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 +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-rm.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-rm.md index 52898c3dd45ae7ea9897af774ddd32f60fdcac7d..121a2b16f4631c36ede78c1bac07132a05e4bb83 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-rm.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-rm.md @@ -1,21 +1,21 @@ # rm -- [命令功能](#section181141523142613) -- [命令格式](#section8800926132619) -- [参数说明](#section15476229152617) -- [使用指南](#section10578163215262) -- [使用实例](#section18548133511263) -- [输出说明](#section1565323814265) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 rm命令用来删除文件或文件夹。 -## 命令格式 +## 命令格式 -rm \[_-r_\] \[_dirname / filename_\] +rm \[_-fv_\] _FILE or rm_ \[_-rv_\] \[_PATH_ | _filename_\]... -## 参数说明 +## 参数说明 **表 1** 参数说明 @@ -30,12 +30,26 @@ rm \[_-r_\] \[_dirname / filename_\]

-r

-

可选参数,若是删除目录则需要该参数。

+

删除空目录或非空目录。

N/A

-

dirname/filename

+

-f

+ +

强制删除:不需要确认,删除不存的文件在也不报错。

+ +

N/A

+ + +

-v

+ +

显示删除的过程。

+ +

N/A

+ + +

PATH/filename

要删除文件或文件夹的名称,支持输入路径。

@@ -45,23 +59,41 @@ rm \[_-r_\] \[_dirname / filename_\] -## 使用指南 +## 使用指南 -- rm命令一次只能删除一个文件或文件夹。 +- rm命令能同时删除多个文件或文件夹。 - rm -r命令可以删除非空目录。 +- 删除不存在的文件会报错。 -## 使用实例 +## 使用实例 举例: -1. 输入rm log1.txt -2. 输入rm -r sd - -## 输出说明 - -**图 1** 用 rm 命令删除文件 log1.txt -![](figure/用-rm-命令删除文件-log1-txt.png "用-rm-命令删除文件-log1-txt") - -**图 2** 用 rm -r 删除目录 sd -![](figure/用-rm--r-删除目录-sd.png "用-rm--r-删除目录-sd") - +1. 输入rm testfile +2. 输入rm -r testpath/ + +## 输出说明 + +**示例 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 +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-rmdir.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-rmdir.md index cc762951bbf9ecf7163243d24666786427016c90..5d568e398b5b3465301f7cc182069fcc43d23d02 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-rmdir.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-rmdir.md @@ -1,21 +1,21 @@ # rmdir -- [命令功能](#section1839611420266) -- [命令格式](#section329574512266) -- [参数说明](#section15865747102620) -- [使用指南](#section107857508261) -- [使用实例](#section11196165315262) -- [输出说明](#section1073811415613) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 rmdir命令用来删除一个目录。 -## 命令格式 +## 命令格式 -rmdir \[_dir_\] +rmdir \[_-p_\] \[_dirname..._\] -## 参数说明 +## 参数说明 **表 1** 参数说明 @@ -28,7 +28,28 @@ rmdir \[_dir_\] -

dir

+

--help

+ +

查看rmdir命令支持的参数列表。

+ +

N/A

+ + +

-p

+ +

删除路径。

+ +

N/A

+ + +

--ignore-fail-on-non-empty

+ +

忽略删除非空目录导致的故障。

+ +

N/A

+ + +

dir

需要删除目录的名称,删除目录必须为空,支持输入路径。

@@ -38,18 +59,24 @@ rmdir \[_dir_\] -## 使用指南 +## 使用指南 - rmdir命令只能用来删除目录。 - rmdir一次只能删除一个目录。 - rmdir只能删除空目录。 -## 使用实例 +## 使用实例 举例:输入rmdir dir -## 输出说明 +## 输出说明 -**图 1** 删除一个名为 dir 的目录 -![](figure/删除一个名为-dir-的目录.png "删除一个名为-dir-的目录") +**示例 1** 删除一个名为 dir 的目录 +```shell +OHOS:/test$ mkdir dir +OHOS:/test$ ls +dir +OHOS:/test$ rmdir dir/ +OHOS:/test$ ls +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-touch.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-touch.md index d98d1833584082919d220bf1cb0e9f129fc1c840..7a10c652a076fe063d8ca4c5f90320b10c105cec 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-touch.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-touch.md @@ -1,26 +1,27 @@ # touch -- [命令功能](#section17541924112716) -- [命令格式](#section866182711274) -- [参数说明](#section268912296270) -- [使用指南](#section412093332714) -- [使用实例](#section414434814354) -- [输出说明](#section1028419515711) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section405) +- [输出说明](#section06) -## 命令功能 +## 命令功能 - touch命令用来在指定的目录下创建一个不存在的空文件。 - touch命令操作已存在的文件会成功,不会更新时间戳。 -## 命令格式 +## 命令格式 -touch \[_filename_\] +touch \[_filename_\] -## 参数说明 +## 参数说明 **表 1** 参数说明 + - + + + + @@ -39,21 +47,40 @@ touch \[_filename_\]

参数

参数说明

@@ -29,7 +30,14 @@ touch \[_filename_\]

filename

+

--help

+

查看touch命令支持的参数列表

+

N/A

+

filename

需要创建文件的名称。

-## 使用指南 +## 使用指南 - touch命令用来创建一个空文件,该文件可读写。 -- 使用touch命令一次只能创建一个文件。 +- 使用touch命令允许一次创建多个文件。 >![](../public_sys-resources/icon-notice.gif) **须知:** >在系统重要资源路径下使用touch命令创建文件,会对系统造成死机等未知影响,如在/dev路径下执行touch uartdev-0,会产生系统卡死现象。 - -## 使用实例 +## 使用实例 举例:输入touch file.c 输出说明 -## 输出说明 - -**图 1** 创建一个名为 file.c 的文件 -![](figure/创建一个名为-file-c-的文件.png "创建一个名为-file-c-的文件") - +## 输出说明 + +**示例 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$ +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-umount.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-umount.md index 9a0b489feae2833b7969e65e42cf30affb9ce831..4356532dc2c3a3ed02298e36ed5d1400e712559d 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-umount.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file-umount.md @@ -1,21 +1,21 @@ # umount -- [命令功能](#section365125133520) -- [命令格式](#section9615254123512) -- [参数说明](#section63446577355) -- [使用指南](#section92931509368) -- [使用实例](#section144311323616) -- [输出说明](#section360525113611) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 umount命令用来卸载指定文件系统。 -## 命令格式 +## 命令格式 -umount \[_dir_\] +umount \[_-a \[-t TYPE\]_\] \[_dir_\] -## 参数说明 +## 参数说明 **表 1** 参数说明 @@ -28,7 +28,29 @@ umount \[_dir_\] -

dir

+

--help

+ +

查看umount命令支持的参数列表。

+ +

N/A

+ + +

-a

+ +

卸载所有已挂载的目录。

+ +

N/A

+ + + +

-t

+ +

同-a选项一起使用,限制-a,只卸载-t所指定的文件系统类型。

+ +

N/A

+ + +

dir

需要卸载文件系统对应的目录。

@@ -38,18 +60,28 @@ umount \[_dir_\] -## 使用指南 +## 使用指南 umount后加上需要卸载的指定文件系统的目录,即将指定文件系统卸载。 -## 使用实例 +## 使用实例 + +举例:umount ./nfs 、umount -a -t nfs ./nfs + +## 输出说明 -举例:umount /bin1/vs/sd +将已在./nfs挂载的文件系统卸载 -## 输出说明 +**示例 1** umount输出示例 -将已在/bin1/vs/sd挂载的文件系统卸载 +```shell +OHOS:/$ umount ./nfs/ +umount ok +``` -**图 1** umount输出示例 -![](figure/umount输出示例.png "umount输出示例") +**示例 2** umount指定文件类型 +```shell +OHOS:/$ umount -a -t nfs ./nfs/ +umount ok +``` diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file.md index 3ba2b47a79660a9639c06b6da8cf738338ae1823..903ec8967f0bbfaa217b76b33266d7b0fff814c5 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-file.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-file.md @@ -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)** - - diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ifconfig.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ifconfig.md index 8d0fef2a09489e221ebd393e4d231cd3e92f33ba..e6e68c7c605d609d6b89047f20f441f3dafeda7b 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ifconfig.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ifconfig.md @@ -1,17 +1,17 @@ # ifconfig -- [命令功能](#section174940284379) -- [命令格式](#section136073203715) -- [参数说明](#section6493235203710) -- [使用指南](#section05763403371) -- [使用实例](#section168802042123717) -- [输出说明](#section124638211109) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 ifconfig命令用来查询和设置网卡的IP地址、网络掩码、网关、硬件mac地址等参数。并能够启用/关闭网卡。 -## 命令格式 +## 命令格式 ifconfig @@ -27,7 +27,7 @@ ifconfig \[_up|down_\] -## 参数说明 +## 参数说明 **表 1** 参数说明 @@ -129,30 +129,30 @@ ifconfig -## 使用指南 +## 使用指南 - 命令需要启动TCP/IP协议栈后才能使用。 - 由于IP冲突检测需要反应时间,每次使用ifconfig设置IP后会有2S左右的延时。 -## 使用实例 +## 使用实例 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 -## 输出说明 +## 输出说明 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 -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 - ``` - - diff --git a/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ping.md b/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ping.md index 41bea417ae13539812ef1d20a996f5cd4b8195ff..0e2eab6f1742ab583c94dd178bfb91931d953ce1 100644 --- a/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ping.md +++ b/zh-cn/device-dev/kernel/kernel-small-debug-shell-net-ping.md @@ -1,25 +1,21 @@ # ping -- [命令功能](#section119672573385) -- [命令格式](#section869419010390) -- [参数说明](#section9877183173918) -- [使用指南](#section1097046193914) -- [使用实例](#section14564129113911) -- [输出说明](#section1621732891215) +- [命令功能](#section01) +- [命令格式](#section02) +- [参数说明](#section03) +- [使用指南](#section04) +- [使用实例](#section05) +- [输出说明](#section06) -## 命令功能 +## 命令功能 ping命令用于测试网络连接是否正常。 -## 命令格式 +## 命令格式 -ping_ _\[_-n cnt_\] \[_-w interval_\] \[_-l data\_len_\]_ _ +ping _\[-4\] \[-c cnt\] \[-f\] \[-i interval\] \[-q\] \[-s size\] _ -ping \[_-t_\] \[_-w interval_\] __ - -ping _-k_ - -## 参数说明 +## 参数说明 **表 1** 参数说明 @@ -32,66 +28,88 @@ ping _-k_ -

IP

+

--help

-

要测试是否网络连通的IPv4地址。

+

查看ping命令支持的参数列表

-

N/A

+

N/A

-

-n cnt

+

-4

+ +

强制以IPV4通讯协议ping目标地址。

-

执行的次数,不带本参数则默认为4次。

+

0-65500

+ + +

-c CNT

+ +

执行的次数,不带本参数则默认为3次。

1-65535

-

-w interval

+

-f

+ +

隐式的ping IPv4地址,其默认参数配置等价于"-c 15 -i 0.2"

+ +

N/A

+ + +

-i interval

发送两次ping包的时间间隔,单位毫秒。

-

>0

+

1-200

-

-l data_len

+

-q

-

ping包,即ICMP echo request报文的数据长度,不包含ICMP包头。

+

隐式的ping IPv4地址,如果主机还存活,则在返回 true 后停止ping。

-

0-65500

+

N/A

-

-t

+

-s SIZE

-

表示永久ping,直到使用ping -k杀死ping线程。

+

设置每个ping包的大小,SIZE是以字节为单位的数据(默认为56字节)。

-

N/A

+

0-4088

-

-k

+

IP

-

杀死ping线程,停止ping。

+

要测试是否网络连通的IPv4地址。

-

N/A

+

N/A

-## 使用指南 +## 使用指南 - ping命令用来测试到目的IP的网络连接是否正常,参数为目的IP地址。 - 如果目的IP不可达,会显示请求超时。 - 如果显示发送错误,说明没有到目的IP的路由。 - 命令需要启动TCP/IP协议栈后才能使用。 -## 使用实例 - -举例:输入ping 192.168.1.10 +## 使用实例 -## 输出说明 +举例:输入ping 192.168.1.3 -**图 1** ping tftp 服务器地址 +## 输出说明 +**示例 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 +```