LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-15-2013, 02:59 AM   #1
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.04
Posts: 271

Rep: Reputation: Disabled
Unhappy (Ubuntu) How to recover files I deleted now by running rm *?


Oh! By mistake I ran rm * on the current directory where I created many c program files. I had been working on these since morning. Now I can't take out again the time that I spent since morning on creating the files. Please say how to recover. They aren't in recycle bin also!!! (I am on Ubuntu13.04)
 
Old 11-15-2013, 03:05 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
You might (!!) be able to recover them.

This has been asked before, have a look at these threads here at LQ:
- restore the data
- Deleted Folder to recover
- Any way of recovering files in my case

Success is not guaranteed, though.

Maybe you can restore from backup?

BTW: Working from the CLI circumvents the use of the recycle bin (unless you created a mechanism yourself).
 
1 members found this post helpful.
Old 11-15-2013, 10:06 AM   #3
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.04
Posts: 271

Original Poster
Rep: Reputation: Disabled
@druuna Many many thanks to you. The links you sent helped me a lot.

Yes, I am able to recover my files. I haven't checked yet whether all are recovered or not but yes a few I have checked are recovered. As there are many many files which are recovered via that tool/command I need to grep some text pattern in those files and see which are mine. The files are recovered with different names (may be generated by system). The command is photorec

Code:
sudo photorec
This will open a text based window. I followed the instructions and yes it's superb.
 
Old 11-15-2013, 10:42 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
You're welcome

BTW: Can you put up the [SOLVED] tag?
- above the first post -> Please Mark this thread as solved if you feel a solution has been provided.
 
Old 11-16-2013, 01:08 AM   #5
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.04
Posts: 271

Original Poster
Rep: Reputation: Disabled
Well though my purpose is solved but 1 thing that I found, I would like to say so that one can put some light on that.
Please see, many files which I deleted were all recovered. But one thing: for 1 file I saw that the last saved matter wasn't recovered. I explain what I mean: I wrote a file, saved then edited again saved and edited.... For that file I see that many files are present in the recovered files. In 1 recovered file 5 lines of code (for that file) is present and in other 30 lines. But the matter that was present in the file when I last saved it couldn't be recovered. So what I mean is that intermediate matters are recovered of that file but the last saved one wasn't present in the recovered files. Does one has any idea why so!! Because it seems if previous matters are recovered then last saved should be obviously be present in the recovered files.
 
Old 11-16-2013, 02:42 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by ravisingh1 View Post
Because it seems if previous matters are recovered then last saved should be obviously be present in the recovered files.
That logic doesn't work.

Simplified: A file is written to disk as a series of blocks. When a file is deleted these blocks are freed and can be overwritten by a newly created file. It is (nearly) impossible to determine which free block(s) are used when a new file is created (one of the reasons being the way fragmentation is handled by Linux).

This is why, if you accidentally delete files, you need to immediately stop working on that machine to make sure that the freed blocks aren't used again (which makes fully restoring them impossible).
 
1 members found this post helpful.
  


Reply

Tags
data recovery, rm, ubuntu13.04


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
[SOLVED] How to Recover Deleted (partly overwritten) Files in /home on ext3 fs, ubuntu 6.06 the_new_z Linux - Newbie 3 08-05-2010 01:44 PM
Any application to recover deleted files in Ubuntu 8.10 vibinlakshman Linux - Software 4 12-13-2008 12:43 AM
is it possible to recover deleted files under Ubuntu vansch76 Linux - Newbie 8 12-11-2007 06:51 PM
How to recover deleted Files sundar_reddy Linux - Software 2 10-25-2007 06:00 PM
Recover deleted files markdw Linux - General 1 12-07-2001 04:08 PM


All times are GMT -5. The time now is 04:59 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration