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 04-14-2011, 09:08 AM   #1
Harsharaj
LQ Newbie
 
Registered: Apr 2011
Posts: 2

Rep: Reputation: 0
how to reterive the folder and removed using rm command in linux


By mistake i deleted imp folder which as certain imp files created, so i want to reterive it ? is it possible by using any specific linux commands only
 
Old 04-14-2011, 09:53 AM   #2
kaiserkarl13
LQ Newbie
 
Registered: Jan 2010
Distribution: Fedora
Posts: 28

Rep: Reputation: 5
Using rm is relatively permanent

You can't easily 'un-rm' a file, unfortunately. The data are still there on disk, but all links to them in the file system table are removed. That's actually what rm does; it deletes the link to the file(s) in the file system table and frees the space so it can be used by other files in the future.

Using some (non-standard) software, it's possible to analyze the hard disk to find deleted files that haven't yet been overwritten. Using even more sophisticated hardware AND software, it's sometimes possible to recreate files that have only been overwritten once. Programs like shred overwrite the disk multiple times with random data specifically to thwart such methods.
 
Old 04-14-2011, 10:15 AM   #3
savona
Member
 
Registered: Mar 2011
Location: Bellmawr, NJ
Distribution: Red Hat / Fedora
Posts: 215

Rep: Reputation: 66
Quote:
Originally Posted by Harsharaj View Post
By mistake i deleted imp folder which as certain imp files created, so i want to reterive it ? is it possible by using any specific linux commands only
Short answer... NO.
 
Old 04-14-2011, 10:27 AM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
You have to use a live medium with testdisk installed. You can then use the photorec program to recover files that are not overwritten now.
I hope you have learned to lessons from that accident:
1. Always have a backup
2. Be extremely careful when working with commands like rm or dd, you can damage your system or loose important data (if no backup was made)
 
1 members found this post helpful.
Old 04-14-2011, 11:06 AM   #5
BashTin
Member
 
Registered: May 2003
Location: West Midlands, United Kingdom.
Distribution: Slackware 14.1, Centos 7
Posts: 278

Rep: Reputation: 32
Depends, what file system are you running? I know from experience for instance that '#> reiserfsck --rebuild-tree /dev/**** works well. And from what I recall there are other methods available for other journaled file systems too. Google is your friend. The important thing to do is not write anything else to disk until you have recovered the data.

BashTin
 
  


Reply

Tags
data recovery, rm, undelete


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
removed all the files from /home folder.tried recovering with foremost.xsession erro harif.konndeth Linux - Newbie 6 09-16-2010 06:48 AM
How do you restore a file that has been removed via the rm command? EnderX Linux - Newbie 4 02-08-2007 10:48 AM
I accidentally removed the netstat command ! markraem Solaris / OpenSolaris 6 10-03-2005 10:18 AM
removed Desktop folder verbose Linux - General 2 09-21-2005 12:18 PM
Linux command to montior a folder saravanan1979 Linux - General 7 06-17-2002 10:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:04 AM.

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