Commands.app

rm

File Management

Remove files or directories

Options & Flags
Available options for this command
-r

Remove directories and their contents recursively

-f

Force removal without confirmation

-i

Prompt before every removal

-v

Verbose output

Examples
Common usage examples

Remove a file

rm file.txt

Remove directory and all contents (use with caution!)

rm -rf directory/

Remove all .txt files with confirmation

rm -i *.txt
Notes
  • Be extremely careful with 'rm -rf', it permanently deletes files
  • Deleted files cannot be recovered easily
Related Commands
You might also find these useful