I misused: "sudo rm -rf /*"


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers I misused: "sudo rm -rf /*"
# 1  
Old 02-04-2019
I misused: "sudo rm -rf /*"

Hey Guys,

I have literally shot my myself in the head...
I tried to use "sudo rm -rf /*" in Terminal (OSX); Unfortunately, I forgot cd Desktop.
After I realized it, I was like Smilie

After that i tried exit; but rm was a background command, so this did not work either...
I came to late for sudo kill 1...

It seems like half of the drive is deleted, Even OS is corrupted. Is there a Way restoring the Data from an SSD card?

Your sincerely,
Niclas
# 2  
Old 02-04-2019
Any chance you have a Time Machine backup?

Make an appointment with your local Apple Store Genius Bar. They'll probably be able to restore macOS on your system. After that, if you had a time machine backup, you can recover everything you had backed up.

Good luck.

Last edited by Don Cragun; 02-04-2019 at 08:00 PM..
This User Gave Thanks to Don Cragun For This Post:
# 3  
Old 02-04-2019
Having enough money for Mac...

I could have eaisly bought a ThunderboltToUSB Adapter, was to stingy...
Smilie Smilie
It is so stupid and hillarious, it is funny again...

Edit: Thanks for the Advice with the OS...
# 4  
Old 02-04-2019
See updated post #2. I'm afraid most, if not all, of your personal data is gone if you didn't have a backup.
# 5  
Old 02-04-2019
Quote:
Originally Posted by Don Cragun
See updated post #2. I'm afraid most, if not all, of your personal data is gone if you didn't have a backup.
Thanks for your advice! Will do that! The iCloud Drive was not corrupted, so it is fine for the personal stuff...
This User Gave Thanks to SuchtyTV For This Post:
# 6  
Old 02-04-2019
First of all, you can restore MacOS when the entire operating system is corrupted using your Time Machine backup.

Not long ago, I was upgrading one of my Macs and the system froze in the middle of OS installation. The box was dead. It would not boot and would barely flicker when powered on.

I went to the web and Googled "restore MacOS from Time Machine" and followed the instructions to hold down some keys, boot off the Time Machine backup, and soon I had my entire ex-corrupted system up and working again. Yea!

OBTW, I own four (active and fully backed up) Macs. One super high end MacPro (my main development machine with 34" ASUS gaming monitor), one MacMini, which I use as a kind of active network storage device, and two MacBook Airs. Each of these machines has a full and mostly current Time Machine backup (based on the last time I upgraded the OS or how active I use it) and I keep it that way; especially for my development machine where I work daily.

Hence, the moral of my story is that you must have backups. There is no excuse for not having them with cheap external SSD drives on the market. Having backups one of the most fundamental things you can do to secure you computer data. It's your responsibility to do this.

So, when you do something wrong and break your system, or the system breaks due to some disk error or other problem, you can restore from backup. Systems always break. They will break at some point in time for some reason you cannot even imagine. This is just as basic of an understanding as making sure you have a spare tire in the back of you car when drive, or as basic has having an extra shoe for your horse on your farm. Your body stores fat as a backup energy supply for your body. Backups are a part of nature and are core to your security.

There is no excuse for not having a backup. Just do it and do it often.

Cheers.
This User Gave Thanks to Neo For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. Shell Programming and Scripting

Explaining behaviour of sudo bash "$0" "$@";

I've found this script part on the stackoverflow: if ; then sudo bash "$0" "$@"; exit "$?"; fi I realized that sudo bash "$0" "$@"; is the only needed for me. But the strange thing happens when I move this line outside the IF statement: sudo bash "$0" "$@"; stops the... (9 Replies)
Discussion started by: boqsc
9 Replies

4. Shell Programming and Scripting

Expect: spawn id exp5 not open while executing "expect "$" { send "sudo su -\r" }"

Hi All, i am trying to ssh to a remote machine and execute certain command to remote machine through script. i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as expect: spawn id exp5 not open while executing "expect "$" {... (3 Replies)
Discussion started by: Siddharth shivh
3 Replies

5. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. UNIX for Dummies Questions & Answers

changing password with sudo user " permission denied"

HI All, I am using solaris i created a user adam and updated his permissions in vi sudoers file as follows adam ALL=(ALL) NOPASSWORD: ALL ........... when i create user by logging as sudo user . $ sudo useradd -d /home/kalyan -m -s /bin/sh kalyan sudo: not found ... (6 Replies)
Discussion started by: kalyankalyan
6 Replies

8. UNIX for Dummies Questions & Answers

Unable to use the Sudo command. "0509-130 Symbol resolution failed for sudo because:"

Hi! I'm very new to unix, so please keep that in mind with the level of language used if you choose to help :D Thanks! When attempting to use sudo on and AIX machine with oslevel 5.1.0.0, I get the following error: exec(): 0509-036 Cannot load program sudo because of the following errors:... (1 Reply)
Discussion started by: Chloe123
1 Replies

9. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
Login or Register to Ask a Question