Linux Comm Rm
# Linux rm Command
[ Linux Command Manual](#)
The Linux rm (English full form: remove) command is used to delete a file or directory.
### Syntax
rm name...
**Parameters**:
* -i Prompt for confirmation before each deletion.
* -f Force deletion without prompting for confirmation, even if the file's attributes are set to read-only.
* -r Recursively delete directories and their contents.
### Examples
To delete a file, you can directly use the rm command. To delete a directory, you must use the "-r" option, for example:
# rm test.txt rm: remove regular file "test.txt"? y # rm homework rm: cannot remove "homework": Is a directory # rm -r homework rm: remove directory "homework"? y
To delete all files and directories in the current directory, the command is:
rm -r *
Once a file is deleted using the rm command, it cannot be recovered, so you must use this command with extreme caution.
[ Linux Command Manual](#)
YouTip