rmdir
Command Function
This command is used to delete a directory.
Syntax
rmdir [-p] [dirname...]
Parameters
Table 1 Parameter description
Suppresses the error message when a non-empty directory is to be deleted. |
||
Specifies the name of the directory to delete. The directory must be empty. A path is supported. |
Usage
- The rmdir command can only be used to delete directories.
- The rmdir command can delete only one directory at a time.
- The rmdir command can delete only empty directories.
Example
Run rmdir dir.
Output
Deleting the directory dir:
OHOS:/test$ mkdir dir
OHOS:/test$ ls
dir
OHOS:/test$ rmdir dir/
OHOS:/test$ ls