LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-30-2012, 01:31 PM   #1
deathschaos9
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
Unhappy Accidentally Deleted Home Folder [CentOS 5.5 32bit]


I'm not exactly a newbie, but I messed up pretty bad and my experience with Linux is not yet at a level where I know how to recover aforementioned deleted folder.

Essentially while in my UNIX course, I was doing the end of chapter questions and testing my work by running the commands on my own virtual server, rather than the one provided by the college (Which is my bad)

So I ran the following
Code:
  917  mkdir .backups
  918  cp -r $HOME/* .backups/
  919  ls
  920  ls .backups/
  921  alias rm='rm'
  922  rm * .backups/
  923  rm -r * .backups/
As you can clearly see, I derped up and deleted the home folder and the backup folder.. Any suggestions on how to recover my data?
 
Old 10-30-2012, 01:43 PM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
There's no easy, bullet-proof way. When you're using rm to delete files rather than a file manager, it's tacitly assumed you know what you're doing / you're happy shooting yourself in the foot / you have a backup.

A search like https://www.google.com/search?q=how+...eleted+with+rm will have various answers, which are mostly along the lines of "not really, no". You can, however, try tools like photorec or Magic Rescue, but I don't anticipate you having much luck... Sorry! (Edit: here's a bigger list of programmes to try)

The lesson I hope you've learnt is to make backups, and put them in places where you won't accidentally delete them... (I mount my backup drive on /media/backup)

Last edited by Snark1994; 10-30-2012 at 01:44 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Accidentally Deleted Public Folder/$Home warning jimwg Linux - Desktop 3 10-20-2012 08:02 AM
HELP!!!! i accidentally deleted my home directory sirpelidor Linux - Software 14 07-19-2010 04:27 AM
I have deleted a folder accidentally? How do I recover it? srikanth_dhondi Linux - Software 2 02-19-2008 06:38 PM
accidentally changed permissions on home folder Cinematography Linux - General 7 05-15-2005 04:32 AM


All times are GMT -5. The time now is 11: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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration