man.lsPlain-English help for Unix commands

rm Remove files and directories

Deletes files, and with -r whole folders. There is no trash and no undo: removed files are gone. Check what you are about to delete before you press Enter.

Synopsis

rm [-f | -i] [-dIRrv] FILE...

Common options

Option or formWhat it does
-r, -RRemove folders and everything inside them. Needed for non-empty folders
-dAlso remove empty folders, without needing -r
-iInteractive: ask before each removal
-IAsk once if more than three files, or a folder tree, would be removed
-fForce: no prompts, and no error if a file does not exist
-vVerbose: print each file as it is removed

Examples

Delete one file
touch old.txt && rm old.txt
Ask before deleting each file
rm -i report.pdf draft.docx
Delete files and show each one
touch a.tmp b.tmp && rm -v a.tmp b.tmp
Delete an empty folder
mkdir scratch && rm -d scratch
Delete a folder and its contents
rm -r docs/old
Delete log files that match a pattern, checking first
ls /var/log/app/*.log && rm -i /var/log/app/*.log

Notes

See also

Last reviewed 2026-10-07.