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 ?

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.

Nitin4873
  • 189
  • 1
  • 1
  • 7