By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

Rm Options Reference

How to use rm to remove files and directories, including an explanation of the different options.

Edited: 2013-04-24 21:29

This page is a reference on the GNU rm command, used to delete files and directories. It should be relevant for both Ubuntu and Debian, as well as other GNU/linux systems.

Here are some of the common options for the rm command used in terminal. Don't forget that you can also just browse your way to the directory, if you prefer to use the GUI – simply right click on the directory or file you want to delete, and chose Move to Trash – but this may require that you run your file manager with sudo from the terminal. I.e..

sodo nautilus

Rm Options

OptionWhat is this?
-v or --verboseShow what is being done. I.e. Prints the filename, before removing the file.
-f or --forceIgnore nonexistent files and doesn't prompt the user.
-iPrompt the user before removing each file.
-IPrompt once whether to proceed with the command, if more than three files are named or if a recursive removal is requested.
--interactive=oncePrompt once whether to proceed with the command, if more than three files are named or if a recursive removal is requested.
--interactive=neverShow no Prompts to the user at all.
--interactive=alwaysPrompt for every file being removed.
--interactiveEquivalent to --interactive=always