This command is used to delete files
Syntax
rm [options] file-list
| Option | Function |
|---|---|
| –interactive -i | Provides an interactive prompt before removing file. |
| –recursive -r | Deletes the contents of the specified directory, including all its subdirectories, and the directory itself |
| –verbose -v | Displays the name of each file as it is removed. |
| –force -f | Without asking for your consent, removes files for which you do not have write access permission. This option also suppresses informative messages if a file does not exist. |
Examples:-
- rm filename
- rm -rf filename
- rm * ( deletes all files in a given directory )