1

Recover Deleted Fils in Ubuntu 14.04

Last night I made a horrible mistake on my Ubuntu 14.04 machine and I deleted the directory that contained my project's Javascript files. All the files where in .js format. I've searched the web for a solution and I tried every tool out there.

Some of the tools I have tried so far are: photorec(testdisk), foremost, ext4magic, extundelete but no chance! None of them have found anything. It seems like they don't find .js files.

I don't know what I'm going to do without my codes. Please help.

aurelien
  • 2,127
  • 5
    now you know why it is routinely and very strongly recommended to back up your data. if you don't have a backup and none of the "this might, under some circumstances, be able to recover some of your data" tools do anything useful, then the data is gone and can not be recovered. – cas Jan 20 '18 at 07:42
  • @cas you're right. it was such a stupid mistake... – m7majidi Jan 20 '18 at 08:25
  • https://unix.stackexchange.com/questions/2677/recovering-accidentally-deleted-files – aurelien Jan 20 '18 at 09:13
  • If you can't find it with the undelete tools, can it be that you moved or renamed files? What command have you used to delete files? Small comment, if there is still the chance that you find other tools over internet which will help you to recover the files it is better to minimize using the file system to prevent overwriting the blocks. – Sasha Che Jan 20 '18 at 15:14
  • You may also want to read this post: https://unix.stackexchange.com/questions/91297/how-to-undelete-just-deleted-directory-with-rm-r-command – Sasha Che Jan 20 '18 at 15:24
  • Also, in future, you may want to consider using a copy-on-write (COW) filesystem such as btrfs or zfs and run a cron job to snapshot the filesystem regularly (and to delete old snapshots. there are several existing tools to automate this for both zfs and btrfs). Snapshots can also be used to make backups with, e.g., btrfs send or zfs send. You should also use a revision control system (e.g. git) for your project files - and push them to a remote repository regularly. This won't recover your lost files but it will make it much harder to make the same mistake in future. – cas Jan 21 '18 at 04:48

1 Answers1

0

If you are having trouble finding something, it may be because it is in a hidden directory. If you deleted something, then it went to your 'Trash' in Ubuntu, unless you specified otherwise. If you haven't tried it already, I would check to make sure you have the option 'Show Hidden Files' enabled when searching through Directories and check out the 'Trash' Directory with it enabled.

Sometimes I've been able to get lucky and recover something that way but it's usually right after something was deleted and if you don't have an automatic purge cycle set.

You can read more into Hidden Files with the link below, if you are not familiar with it.

https://help.ubuntu.com/stable/ubuntu-help/files-hidden.html