LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

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


Hi,

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, 08:54 PM   #2
Demonbane
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)
Code:
alias rm='rm -i'
and make sure something like this is in ~/.bash_profile
Code:
[ -f ~/.bashrc ] && . ~/.bashrc
 
Old 03-14-2004, 08:55 PM   #3
chii-chan
Member
 
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 07:12 PM.
 
  


Reply



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 06:18 AM
problem deleting file using solaris command line. szehanz Solaris / OpenSolaris 2 03-22-2005 07:52 PM
rm command - deleting directories Micro420 Linux - Newbie 11 11-02-2003 02:18 PM
Is there a way to make a partition bigger without deleting whats on it? Fathonkey Linux - General 20 06-07-2003 02:25 PM
simple 'rm' question ... purpleburple Linux - General 6 10-12-2002 10:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:56 PM.

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