Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-14-2004, 09:42 PM   #1
LQ Newbie
Registered: Mar 2004
Posts: 21

Rep: Reputation: 15
How can I make the 'rm' command to always ask me before deleting?


i am a linux beginner...i was wondering if someone could tell me how i can make the rm command to rm -i ? So that i am always asked before deleting something....
Old 03-14-2004, 09:54 PM   #2
LQ Guru
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Put this in your ~/.bashrc (create it if it doesn't exist)
alias rm='rm -i'
and make sure something like this is in ~/.bash_profile
[ -f ~/.bashrc ] && . ~/.bashrc
Old 03-14-2004, 09:55 PM   #3
Registered: Sep 2003
Location: chikyuu (E103N6)
Distribution: Redhat 8.0 (2.4.25-custom), Fedora Core 1 (2.4.30-custom)
Posts: 357

Rep: Reputation: 30
Add the following line in .bashrc in your home directory:

alias rm='rm -i'

then in your home directory type:

. .bashrc to update the profile.

There is a space between the dots.

Edited: sorry i didn't notice that the question was already answered.

Last edited by chii-chan; 03-16-2004 at 08:12 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
'cp' and 'rm' don't act upon hidden files? Rodolfo Medina Linux - General 2 09-26-2005 07:18 AM
problem deleting file using solaris command line. szehanz Solaris / OpenSolaris 2 03-22-2005 08:52 PM
rm command - deleting directories Micro420 Linux - Newbie 11 11-02-2003 03:18 PM
Is there a way to make a partition bigger without deleting whats on it? Fathonkey Linux - General 20 06-07-2003 03:25 PM
simple 'rm' question ... purpleburple Linux - General 6 10-12-2002 11:12 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:59 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration