Making the rm command interactive so that you dont delete files by mistake

The rm command by default does not prompt you before deleting files, most people prefer it this way, you can however have rm prompt you by using the i option. To avoid using the i option each time you delete a file make changes to the .bashrc file.

To have rm ask you:

rm: remove regular empty file `fine_name’?

each time, append the following line to you ~/.bashrc file:

alias rm=’rm -i’

Open up a terminal window(Applications>Accessories>terminal on Gnome) andtry deleting any file, from now on rm will check with you before deleting 😉

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: