Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > rm command in bash

rm command in bash
Thread Tools
Fresh-Faced Recruit
Join Date: May 2004
Status: Offline
Reply With Quote
Jul 14, 2004, 10:56 AM
 
Hey all. I am wondering if there is a way to set my bash shell to warn me before deleting files using rm? As in, I type in "rm file" and it replies "rm: remove 'file'? " (or some such thing). (I'm running 10.3.4 by the way.) I noticed that the unix boxes I use at work do this, but I don't know how to configure bash to do this. Any info would be great. Thanks.
     
Junior Member
Join Date: Oct 2003
Status: Offline
Reply With Quote
Jul 14, 2004, 11:07 AM
 
You can do this using an alias. "rm -i" is what you're looking for. Usually, you czn put aliases in your .bashrc file, or in /etc/bashrc if you want it to work for any user.
man bash for the gory details.

Don't depend on it, though. Sucks to oopsify a file on someone else's box...
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:10 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2