LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 09-15-2006, 09:16 PM   #1
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
why you should not be working on a friday night


funny story.

while in my coding directory, the one with all my projects and for some not-so-well-though-out reason it also includes my primary subversion repository, i was testing out a copy script that was copying some files to a temp dir in that dir. i got the script working and wanted to clear out the temp dir and test one more time just to be sure so i issued a

rm * temp/ -Rf

this boys and girls is why you DO NOT WORK ON A FRIDAY NIGHT!

after 7+ years on linux i still amaze myself with idiotic taps of my fingers
 
Old 09-15-2006, 09:48 PM   #2
stitchman
Member
 
Registered: Dec 2005
Distribution: Slackware 13.1
Posts: 82

Rep: Reputation: 15
man that sucks. i didnt even see the mistake the first 2 times i read it. i need sleep too
 
Old 09-15-2006, 10:01 PM   #3
General
Member
 
Registered: Aug 2005
Distribution: Debian 7
Posts: 526

Rep: Reputation: 31
There should be some sorm of protection against this sort of thing, built right into BASH.

"WARNING: The command you have chosen will result in the deletion of 3,050,110 file(s). Are you certain that you wish to continue? (y/N)"
 
Old 09-15-2006, 10:43 PM   #4
Cirdan
Member
 
Registered: Nov 2005
Distribution: Arch Linux
Posts: 84

Rep: Reputation: 15
What should it have been? temp/* I presume. lol
 
Old 09-15-2006, 11:29 PM   #5
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Original Poster
Rep: Reputation: 45
Quote:
Originally Posted by Cirdan
What should it have been? temp/* I presume.
yes youre right, temp/*

Quote:
Originally Posted by Cirdan
lol
exactly
i am considering adding to my sig

Quote:
Originally Posted by General
"WARNING: The command you have chosen will result in the deletion of 3,050,110 file(s). Are you certain that you wish to continue? (y/N)"
thats funny. seriously i am laughing for the first time in the last hour.. in my case it was probably only about 5,000 files, but when you get up over the 1000 mark of important files, the remainder really doesnt matter..

Quote:
Originally Posted by General
There should be some sorm of protection against this sort of thing, built right into BASH.
maybe, but if you bring this up to most linux people though they will say "bah!, dont be an idiot".. and normally i would say about that same thing also. probably a good "in someone elses shoes" moment.

just a stupid mistake. the asterix is now my most hated enemy.

Quote:
Originally Posted by stitchman
i need sleep too
yes i would go to sleep but i am afraid that i will dream about rm * commands
 
Old 09-15-2006, 11:31 PM   #6
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Original Poster
Rep: Reputation: 45
heh. i thought that it was taking an awful long time to remove 100 files. about 50 times too long.. blah.
 
Old 09-15-2006, 11:46 PM   #7
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Quote:
There should be some sorm of protection against this sort of thing, built right into BASH.
man, rm already has that prompt/warning for deleting files, but if you choose to override it using the -f option, God help you.

From the manual of rm
Code:
       -f, --force
              ignore nonexistent files, never prompt

Last edited by vharishankar; 09-15-2006 at 11:50 PM.
 
Old 09-15-2006, 11:55 PM   #8
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Original Poster
Rep: Reputation: 45
Quote:
Originally Posted by Harishankar
man, rm already has that prompt/warning for deleting files, but if you choose to override it using the -f option, God help you.

From the manual of rm
Code:
       -f, --force
              ignore nonexistent files, never prompt
yeh good point. BUT, there is only a rm warning for write protected files, that is mainly what the -f is used to override. and there was only a couple of files that were write protected in the dir i was dumping. unfortunately, all the files in the .svn dirs in my eclipse workspace were some of those because of the erroneous rm command.

i am not an advocate for changing rm, however now i am an advocate for not being a moron.
 
Old 09-16-2006, 12:26 AM   #9
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
<begin obvious>
Yes, I know. Sometimes we use options without thinking at all. Unfortunately a computer, not being an intelligent being, just does what we ask it to do. Nothing more or less.
</end obvious>

It happens to all of us at times. I once cleaned out my Debian installation because I overwrote the wrong partition.

Sometimes it's better to use a GUI mode for these kinds of things as we know exactly what we're doing. CLI is very powerful and sometimes that power can be more than we can handle.

Last edited by vharishankar; 09-16-2006 at 12:27 AM.
 
Old 09-16-2006, 01:11 AM   #10
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Original Poster
Rep: Reputation: 45
yeh a person can talk alot of smack about how using the cmd line is way better, until that person goes and does something like that person did.. then that person wishes they had the trash bin to recover their dignity from.

eh, still this is not enough to drive me to using a gui anymore than i do now. its just a bump in the road. i have done many a dumb thing over the years, this is just another on the list.

atleast all of my work-work is backed up at work, i only lost about 3 hours of time. but i did lose about 5 personal projects that i had put alot of time into..

now my only hope is that the whiskey will cure the pain..
 
Old 09-16-2006, 01:18 AM   #11
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Original Poster
Rep: Reputation: 45
i guess the only reason i admitted that i did this was so that everyone i have pissed off here could have a good laugh at my expense
 
Old 09-16-2006, 02:27 AM   #12
Garda
Member
 
Registered: May 2005
Distribution: Debian
Posts: 83
Blog Entries: 2

Rep: Reputation: 15
only 1 thing to say

OUCH!!!!
 
Old 09-16-2006, 08:51 AM   #13
sumguy231
Member
 
Registered: Apr 2004
Location: North America
Distribution: Kubuntu 7.04 - Feisty Fawn
Posts: 296

Rep: Reputation: 30
I read this thread way late last night, and wouldn't you know it: I woke up this morning all freaked out after I dreamed I did the same thing (Worse yet, I don't have any backup hardware yet).
P.S. And don't get me started on the part where it got all psychadelic and the screen started rolling and melting. That's just typical of my dreams.

Last edited by sumguy231; 09-16-2006 at 03:32 PM.
 
Old 09-16-2006, 01:52 PM   #14
DJ Shaji
Member
 
Registered: Dec 2004
Location: Yo Momma's house
Distribution: Fedora Rawhide, ArchLinux
Posts: 518
Blog Entries: 15

Rep: Reputation: 106Reputation: 106
Ok, so, this, I'm gonna save, and make sure that this file opens each and every time I log into GNOME

Thanks for sharing that, buddy Believe me, you're not the only one whose done this! There're more of us than you think!
 
Old 09-19-2006, 11:19 AM   #15
the_darkside_986
Member
 
Registered: Feb 2006
Distribution: Ubuntu Feisty (7.04)
Posts: 106

Rep: Reputation: 15
Dang that sucks. I do most of my rm from the command line, but things like this remind me why I should NEVER use the -f option. I'd rather sit and type "y" over and over again than do something like that.
 
  


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
LXer: Chat with Mike Schroepfer This Friday LXer Syndicated Linux News 0 08-30-2006 08:33 AM
National Makeout Day and Night on Friday smith847be General 2 10-19-2004 04:06 PM
It's Friday! KungFuHamster General 6 07-11-2003 11:53 PM
An Old Tradition: Its Friday! crokett General 27 02-21-2003 08:38 PM
It's Another Friday Texicle General 6 02-21-2003 07:17 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 01:29 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