"mv file" and now it's missing

It has gone nowhere, its in the current directory. It has been renamed as .... (four dots).

As any filename having a . in front is treated a hidden file, so it has become hidden. So, if you do ls, you won't find it. Like always, you need the -a (or -A) option of ls to view the hidden files i.e. ls -a (or ls -A) to see it.

Let me break it down, you ran mv filename ..\.. , the first two dots would mean the parent directory if it were ../, but you have used backward slash ..\ which indicates shell to escape the next character but a dot . has no special meaning to shell. So, it will treat it as a literal . and the last . also added, so you got four dots .... as a filename.

To revert back to the previous (original) name, run mv .... filename.


Run mv .... filename to rename it back. (mv ..\.. filename would work too, but the \ is superfluous--as it was in your original command.)

  • The file hasn't been deleted, which is why searching for recoverable deleted files didn't find it.
  • Like in Windows, . and .. entries are present in every directory and refer to the "current" and "parent" directories respectively. But unlike in Windows, sequences of more than two dots don't have any special meaning. Though it's unusual, you're perfectly free to name an ordinary file with a name consisting entirely of dots, so long as it is at least three dots long.
  • Unlike in Windows, in Ubuntu the shell uses \ as an escape character, ensuring the shell treats the following character literally rather than giving it a special meaning. The . character has no special meaning in the shell (in particular, the shell is not what's responsible for making the . and .. entries work). Therefore, in your command, \. was equivalent to ..
  • As heemayl says, by default most utilities don't show files and directories whose names start with a .. Since .... starts with ., running ls without the -A or -a flag did not reveal it.

it is still in the same directory, just a 'hidden' file now. You can recover it by "mv .... filename".