Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question already has an answer here:

I accidentally removed some important files from Linux with rm *. How can I restore those files?

The distribution used is CentOS 6.4

share|improve this question

migrated from stackoverflow.com Jul 15 '13 at 13:17

This question came from our site for professional and enthusiast programmers.

marked as duplicate by slhck Jul 15 '13 at 13:49

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.

    
That depends on your filesystem. If you use good filesystem, it's impossible! –  Eddy_Em Jul 15 '13 at 13:16
    
I think the recovery operation also depends on you file system type, I don't know if ext3/4 can be easily recovered. Meanwhile, maybe some node in disk can help you. Anyway, why you use rm *? you can write a save rm command and first mv the thing you wan to delete into trash –  How Chen Jul 15 '13 at 13:17

2 Answers 2

First of all, remount partition file was on read only. Then look at extundelete.

share|improve this answer

you may try "Scalpel" it may be help. Scalpel is an open source file system recovery for Linux.

command for installing scalpel # yum install scalpel Once scalpel is installed you need to do text editing. By default scalpel utility has its own configuration file in ‘/etc‘ directory and full path is “/etc/scalpel/scalpel.conf” or “/etc/scalpel.conf“. You can notice that everything is commented out (#). So before running scalpel you need to uncomment the file format that you need to recover. However uncomment the entire file is time consuming and will generate a huge false results.

Let say for example I want to recover only ‘.jpg‘ files, so simply uncomment ‘.jpg‘ file section for the scalpel configuration file. Go to terminal and type following syntax. The ‘/dev/sda1‘ is a location of a device from where the file is already deleted. As you see, the scalpel is now performing its process and it will take time to recovery your deleted file depending upon the disk space that you are trying to scan and the speed of the machine.

I would recommend you all to have a habit of using only delete instead of “Shift + Delete“. Because as said prevention is always better than cure.

share|improve this answer