Can I recover a file in linux which i accidentally did an "rm" on?

kal picture kal · Jan 23, 2009 · Viewed 11.7k times · Source

Do you know of any tools/commands by which I recover files which I accidentally removed?

Answer

Federico A. Ramponi picture Federico A. Ramponi · Jan 23, 2009
  • Don't do anything on the partition; unmount it as it is;
  • Install the TestDisk suite, or boot from a live distribution with a recovery suite installed (see the TestDisk wikipedia page);
  • I found the PhotoRec utility very useful in similar situations (it was on a VFAT partition, but I guess it works also on ext2).