0

I accidentally executed

rm –rf * 

command in /home/apps/ directory on putty console. apps directory contains our all data. I exited immediately (pressing Ctrl+C), but few files been deleted. I don't know exact which files have been deleted.

How do I recover these deleted files ?

Sathyajith Bhat
  • 61,504
  • 38
  • 179
  • 264
  • [extundelete](http://extundelete.sourceforge.net/) *may* help, but sorry to break it to you, but you should reach for backup. Other than that, this is off-topic here. – mvp Jun 13 '13 at 07:02

2 Answers2

0

Try recovering it with grep in a single user mode.. See if this helps:

http://www.cyberciti.biz/tips/linuxunix-recover-deleted-files.html

0

Its very irritating thing to happen, faced that sometimes. Lost 2 weeks of dev work once. :(

But the reality remains unless there is a backup taken by the system team, you can't recover things in unix. There is no concept of recycle bin or temporary storage before final removal in Unix or Linux.

But you can prevent this in future by making an alias for rm -rf to point to a script that would check if the files are src code , other. Move them to a temp directory where you can review it later and subsequently remove them.

That's what I had done in my previous project.

Sathyajith Bhat
  • 61,504
  • 38
  • 179
  • 264
Nitin4873
  • 189
  • 1
  • 1
  • 7
  • would the downvoter care to explain how he can get the exact data once removed without having a backup? – Nitin4873 Jun 13 '13 at 19:22