This command looks through the currently running processes and kills
the those that match the selection criteria. This way system can send
signal to processes by name and without knowing the IDs.
Example (kill application hello):
pkill -15 hello
The command can be turned off by NSH_DISABLE_PKILL option and depends
on FS_PROCFS.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
In below two cases "rm" command with "-f" option will return 0:
a. Bad arguments
b. File not exists
Following "rm" of GNU coreutils 8.32
GNU coreutils
$ rm --version
rm (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Paul Rubin, David MacKenzie, Richard M. Stallman,
and Jim Meyering.
$ rm /FILE_NOT_EXISTS
rm: cannot remove '/FILE_NOT_EXISTS': No such file or directory
$ echo $?
1
$ rm -f
$ echo $?
0
$ rm -f /FILE_NOT_EXISTS
$ echo $?
0
Without this patch
nsh> rm
nsh: rm: missing required argument(s)
nsh> rm /FILE_NOT_EXISTS
nsh: rm: unlink failed: 2
nsh> echo $?
1
With this patch
nsh> rm -f
nsh> echo $?
0
nsh> rm -f /FILE_NOT_EXISTS
nsh> echo $?
0
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Currently new users when try to run NuttX using the SIM
get stuck into simulator, because they have no idea that
poweroff command is used to leave it. Let use KISS approach
and use quit as an alias to poweroff command.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
Now the dd command can use the "seek" parameter to adjust how many bytes need to be skipped before being written to the target.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
To support rpmsg ioctl, add cmd_rpmsg function, and update rptun ping to rpmsg ping.
depends on apache/nuttx#11618
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
Add the API "nsh_getpid" in "nsh_fsutils. c" and the nsh command pidof. Temporarily support two parameters, - s, and process name
Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
Test on sim/nsh (CONFIG_NSH_DISABLE_HELP=y):
text data bss dec hex filename
393746 26824 4000 424570 67a7a nuttx /* before */
391858 26440 4000 422298 6719a nuttx /* after */
-1888 -384
Signed-off-by: chao an <anchao@xiaomi.com>
switchboot <image path>
Switch to the updated or specified boot system. This command depends on
hardware support CONFIG_BOARDCTL_SWITCH_BOOT. `<image path>` point to a
partion or file which contain the firmware to boot.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
boot [<image path> [<header size>]]
Boot a new firmware image. This command depends on hardware support
CONFIG_BOARDCTL_BOOT_IMAGE. <image path> may point to a partion or file
which contain the firmware to boot. The optional, numeric argument
<header size> may be useful for skipping metadata information preprended
to the firmware image.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This adds support for string aliases into nsh. There are some nuances that
are not handled correctly yet:
- Reserved words can be overloaded, which is a clear POSIX violation
Introduced by https://github.com/apache/nuttx-apps/pull/1610,
internal line buffer should have more bytes for tab before newline and '\0'.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
From comment in cmd_ifconfig, it seems that we support `ifconfig [interface]`, but actually not considering the interface param now. After this commit, we only print the information of interface specified in param, just like linux.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
run uptime command on sim:
nsh>
nsh>
nsh> uptime
19:35:01 up 1:40, load average: 0.00, 0.00, 0.00
nsh>
nsh>
nsh> uptime -s
2022-09-16 17:54:26
nsh>
nsh>
nsh> uptime -p
up 1 hour, 40 minutes
nsh>
nsh>
nsh> uptime -h
Usage:
uptime [options]
Options:
-p, show uptime in pretty format
-h, display this help and exit
-s, system up since
nsh>
nsh>
nsh> uptime -abc
uptime: invalid option -- -abc
Usage:
uptime [options]
Options:
-p, show uptime in pretty format
-h, display this help and exit
-s, system up since
nsh>
nsh>
nsh> date
Fri, Sep 16 19:35:18 2022
nsh>
nsh>
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>