Move to directory that was no directory

I did this:

mv couchpotato_11-08-2016_09-35.tar.gz ~/AtoMiC-ToolKit/backup
mv transmission-daemon_11-08-2016_09-36.tar.gz ~/AtoMiC-ToolKit/backup
mv sickrage_11-08-2016_09-35.tar.gz ~/AtoMiC-ToolKit/backup

But backup was no directory or file, and now the files are gone.

How do I find or restore these files?


Solution 1:

Your files are gone and only your last file 'sickrage_11-08-2016_09-35.tar.gz ' is still there and renamed to 'backup' in '~/AtoMiC-ToolKit/'

To restoring it back just run (assuming you didn't change your working directory yet)

mv ~/AtoMiC-ToolKit/backup $PWD/sickrage_11-08-2016_09-35.tar.gz

Solution 2:

If backup didn't exist as a directory, a file will be created with that name. Then your second and third mv command would overwrite the previous. You won't be able to retreive the previous files.

Solution 3:

When no destination folder exists, mv doesn't move the file rather renames it. Had you used it just once you could have recovered the file, but you used it thrice so first and second file got overwritten by the third file

So basically sickrage_11-08-2016_09-35.tar.gz is now ~/AtoMiC-ToolKit/backup. If it doesnt show up, turn the "Show Hidden Files" option on to see it.