Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How to recover deleted files?

I created directory inside /var/www/demo, and placed some files there. By mistake I pressed the delete button, and my files were deleted. Now I don’t have these files. So how to recover my data from this /var/www/ directory.

share|improve this question

marked as duplicate by Javier Rivera, Jorge Castro, Mik, Ringtail, devav2 Oct 31 '12 at 5:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Before you start recovering you might want to search for the files - sometimes you just misplace the files somehow. Try this in the Terminal: "sudo find / -name *.html". Switch out for .php if that is what you are using. Good luck! –  Gjermund Bjaanes Oct 30 '12 at 8:58

3 Answers 3

If these files were deleted with the Nautilus file manager they will be in the Trash bin. By default the Trash bin is the icon in the bottom right of the screen.

If the files were deleted with the command line then the files cannot be recovered easily. There are some tools to "undeleted" files but I never used any of those.

share|improve this answer
    
i delete my file using the delete button from the key board. but i never found from the Trash. –  diff Jul 6 '11 at 11:26
    
And were you inside a Nautilus file manager or in some other application when you pressed delete? –  jmbouffard Jul 6 '11 at 11:35
    
was /var/www on your local drive or running on a remote server/system? if it's on a remote system it will be extremely hard to recover the files –  Thomas W. Jul 6 '11 at 12:00
3  
If he deleted it with Nautilus then he was probably running it as root, maybe /root/.Trash or something? –  Jorge Castro Jul 6 '11 at 12:11
    
it was /var/www on your local drive, then ? –  diff Jul 6 '11 at 17:03

if this were not found, to recover deleted files you can use testdisk

sudo apt-get install testdisk

I've used it, and all files recovered.

share|improve this answer

The files were deleted as a root user. You would find them in /root/.local/share/Trash/files (For versions older than Ubuntu 11.10, you would find them in /root/.Trash).

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.