I used the command
mv folder_name ....
I thought by using
.. twice, it would move it back two folders.
Unfortunately my files disappeared.
I need to recover them.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Your directory is still there :)
You have renamed it
Because files whose names start with
. are hidden, you cannot see the directory unless you display hidden files
and there it is!
Revert the change:
mv .... original_folder_name
and do the move correctly
mv original_folder_name ../..
The correct form would have been
mv folder_name ../..
You've moved your folder to a new folder named
....; to recover your files, run
mv .... folder_name
Like many other commands,
mv is somewhat dangerous because mistakes can in some cases cause unrecoverable loss of data (except from backups): anything which ends up being interpreted as "move these files to this file" will cause all the files apart from the last one to be lost (each file will be renamed in turn to the target). To prevent such mistakes, there are a number of techniques:
-i, which tells
mvto ask for confirmation before overwriting;
-tto specify the target folder (so
mvwill only move to a target folder);
/at the end of the target folder's name.