I think it's safe to say from the comments that we're all confused on exactly what happened in this case based on the current information. If it helps, I wasn't able to reproduce your issue using the following scenario in Ubuntu on WSL:
cd /
sudo mkdir c_dir
cd c_dir
sudo touch abc 1 2 3
cd /
sudo mv c_dir/ mnt/c/Users/ntd/Documents/to_be_compiled
The directory /c_dir
was renamed (moved) to the to_be_compiled
directory in the proper location, with all files present.
That said, best practice would certainly be to use the fully qualified directory names (starting with a /
) rather than the relative form that you used. I'm wondering if perhaps the files are someplace else based on your working directory when you ran the mv
command.
Note that the actual ownership and permissions will vary depending on whether you have changed the automount settings in /etc/wsl.conf
.
With a default WSL installation, the files will be owned by your user once they are moved to the Windows drive, with 777 permissions.
I have mine changed slightly, with the following in /etc/wsl.conf
:
[automount]
options = "metadata,umask=22,fmask=11"
With that in place, WSL attempts to mimic the actual Linux ownership and permissions, so the files are owned by root
(since they were moved with sudo
) and the permissions are 644.
directory
. Imoved
it./
root folder when you ran that command, then that looks like a valid move ... at least in WSL2