rm (delete files) Deletes (removes) one or more files.Format: rm filelist Examples: rm file1 file2 To remove files, you must have write permissions to the directory where the file is located, but not on the file itself. Opt | What It Does | Examples |
---|
-d | Remove directories, even if not empty (only available to a privileged user) | rm -d /home/janet/dir2 | -f | Remove write-protected files without querying | rm -f file26.txt | -I | Prompt before deleting | rm -I test*.txt | -r | For a directory, remove all the files in the directory and subdirectories | rm -r /home/janet/di 3 | -v | Display name before deleting | rm -r report* | |