Some context, earlier I was moving files and mistyped up a directory mv <file> .. as mv <file .> and got the usual complaint ’ and are the same’.
so trying to fix it, I fat finger as mv <file ...> no complaint and the file is gone, not up a directory, nor two or three (or anywhere up or down the tree. ... and it’s not an alias
Hey, sorry to bump this older thread . But I think this would help others too.
First, know that every directory in a linux/unix filesystem has a . and .. entry. . resolves to the current directory and .. resolves to the parent directory.
mv <file> . # attempts to move the file to the current directory
mv <file> .. # attempts to move the file to the parent directory
mv <file> ... # attempts to move the file to "..." in the **current** directory
Also, I tried to dig into the documentation myself. But . and .. are not shell extensions from bash. They go deeper than that, since they are a part of the Linux C interface. There are formal explanations in the path_resolution man page, if you have it.