3

I'm new to Linux and its terminal. I'm using Ubuntu 12.04, trying to learn about the Terminal's commands. I learned how to remove files and directories but saw that the system never asks you if you are sure to remove or not, like showing a Y/N question, is there a way to have that (instead of using rmdir and rm and rm -R) ? like some command that generates a Y/N confirmation question.

1 Answers1

6

When you type rm -i fileA fileB fileC, you'll get asked for confirmation for every file.

So you could define the alias rmi=rm -i in your shell's configuration (e.g. ~/.bashrc for bash), and learn to type rmi instead of rm.

Some Linuxes even define rm=rm -i, but then you'll start relying on this behavior whenever you enter rm.


You could also install trash, which brings a "move to trash" command to your shell.

Daniel Beck
  • 110,419