rm
Command Function
This command is used to delete a file or folder.
Syntax
rm [-r] [dirname / filename]
Parameters
Table 1 Parameter description
Deletes a directory. This parameter is optional. It is required if a directory is to be deleted. |
||
Specifies the name of the file or directory to be deleted. The value can be a path. |
Usage
- The rm command deletes only one file or directory at a time.
- The rm -r command can be used to delete a non-empty directory.
Example
Example:
- Run rm log1.txt.
- Run rm -r sd.