Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to undo rm -rf? [closed]

How we I undo the rm -rf command?

For example, I have an Application folder and I removed it with:

rm -rf Application

But it was my mistake and want to recover that Application folder, but it's not in Trash folder.

What should I do now? Is there any command to undo rm -rf?

like image 598
Amrit Dhungana Avatar asked Jan 22 '14 23:01

Amrit Dhungana


1 Answers

Short answer: you can't¹. Files that get unlinked are irreversibly gone. If you really cared about what you deleted (e.g. personal files that cannot be reproduced), you could run photorec and try to recover as many files as possible, but you will loose any directory structure and naming.

Anyway, since you deleted the Applications folder, reinstalling everything could be the simple way to go. Provided that Applications folder contained installed applications.


1: some filesystems (will) support undeletion, but it's not your case.

like image 110
Stefano Sanfilippo Avatar answered Sep 28 '22 07:09

Stefano Sanfilippo