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 > macOS > sudo rm -r * troubles ;-)

sudo rm -r * troubles ;-)
Thread Tools
macvillage.net
Addicted to MacNN
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jul 11, 2003, 10:27 PM
 
A friend of mine, wanted to be a *nix pro, with his OS X system... and did something a bit funny.

Code:
cd / sudo rm -r * Password:
Performed the task.

Then he suspended the task after a second or two.

To my suprise, he was able to restart. Doesn't seem to have any problems.


Think he deleted anything important?

Notices no changes. He boots, all apps are still there. No issues.


Odd eh?
     
foobars
Mac Elite
Join Date: Jan 2001
Location: Somewhere in the land surrouding Fenway Park
Status: Offline
Reply With Quote
Jul 11, 2003, 10:59 PM
 
Are you sure all his apps are there? It should work alphabetically, so the first app in his Appliction folder probally has some files missing from the package at least...
     
mrmister
Mac Elite
Join Date: Aug 2000
Status: Offline
Reply With Quote
Jul 12, 2003, 12:20 AM
 
Yeah, I bet Address Book isn't looking so hot.
     
CatOne
Mac Elite
Join Date: Nov 2001
Status: Offline
Reply With Quote
Jul 12, 2003, 12:43 AM
 
I'd say... pretty soon he's gonna notice something that's pretty f*cked up.

I did this once by accident with a typo when I tried to delete the OS 9 system folder

(instead of rm -rf system\ folder I tried rm -rf system \folder and that's bad because it does 'system').

Anyway, I caught it after about 5 seconds but on reboot I had lines and crap all over the screen.

Trust me... he'll figure out soon that he's in deep sh*t. Back up the data, reformat, reinstall.
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jul 12, 2003, 06:52 AM
 
The * saved his life. He just toasted everything in the current directory, wherever he happened to be located. If it had been / instead, he'd have removed everything

So, probably everything in his home dir is gone (that's the default dir for new shells). And tell him not to use the shell unless he knows what he's doing.
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jul 12, 2003, 06:57 AM
 
Originally posted by Angus_D:
The * saved his life. He just toasted everything in the current directory, wherever he happened to be located. If it had been / instead, he'd have removed everything
He cd'd to / in the first line.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
theolein
Addicted to MacNN
Join Date: Feb 2001
Location: zurich, switzerland
Status: Offline
Reply With Quote
Jul 12, 2003, 07:45 AM
 
If you look, you'll see he didn't use the -f switch. This forces deletion, and you have to use it if you want to delete things that belong to the root user for instance. Normally rm will prompt you for permission without the -f option.
weird wabbit
     
Zim
Senior User
Join Date: Apr 2001
Location: Cary, NC
Status: Offline
Reply With Quote
Jul 12, 2003, 09:20 AM
 
Originally posted by theolein:
If you look, you'll see he didn't use the -f switch. This forces deletion, and you have to use it if you want to delete things that belong to the root user for instance. Normally rm will prompt you for permission without the -f option.
Notice that the original poster did "sudo".

A series of tests...

>sudo which rm
/bin/rm # ergo it is not aliased to rm -i

>touch test
>sudo rm test

no prompt. I've always found -f is the default, and if I want -i behavior I have to alias rm 'rm -i'. This with 15 years experience over various flavors of unix.

Mike
     
fat mac moron
Grizzled Veteran
Join Date: Sep 2002
Status: Offline
Reply With Quote
Jul 12, 2003, 03:37 PM
 
Originally posted by Zim:
I've always found -f is the default, and if I want -i behavior I have to alias rm 'rm -i'. This with 15 years experience over various flavors of unix.

Mike
Yup, I do the same thing with every shell on Unix machines that I work with. It's way, way too easy to type the wrong thing into the shell and end up deleting a file you didn't intend to.

Now if I can just prevent myself from piping and redirecting stuff into wrong place...
     
   
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
Top
Privacy Policy
All times are GMT -4. The time now is 03:51 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,