Table of Contents
Problem
I was using Windows Subsystem for Linux with Ubuntu 18.04. I ran:
mv venv ../d/
After that, the venv directory could not be found in the current directory or in d. I double-checked the command in .bash_history. Here, venv is a folder, and d is a link to /mnt/d/ubuntu1804/ on my Windows D: drive.
However, when I ran:
mv a.txt ../d/
it worked fine, and the file could be found in d.
The current working directory was c, which is a link to /mnt/c/ubuntu1804/.
Solution
The directory was not lost. It had actually been moved to the root of the C: drive, under a directory named d.
In WSL, this kind of confusion can happen when moving files through paths that involve symlinks and ... The path may not resolve to the location you expect. Before running a destructive move, check the physical paths with:
pwd
pwd -P
ls -ld ../d
readlink -f ../d
A safer version is to use the real mounted path directly:
mv venv /mnt/d/ubuntu1804/
If this happens, look for the moved directory from Windows or WSL at the unexpected destination, for example:
ls /mnt/c/d
Then move it back to the intended D: drive path:
mv /mnt/c/d/venv /mnt/d/ubuntu1804/
