The ln command in Linux is used to create a link between files. This is useful for sharing files between your local machine and WSL.
I’m linking to a ‘projects’ folder in this post but I get an error when cloning git repos in them (chmod error). Using mounted Windows drives for version-controlled projects is appearing to be a no-go.
# Create sym link wsl ln -s /mnt/c/projects
-s Create symbolic links instead of hard links.
First I’m creating a local folder and then creating a link to the folder in my WSL home directory.
Next, I’m creating a new folder and file within WSL on the linked folder.
And here’s the file created above shown within the local Windows environment.
List the files (-lai) to check for existing links ad then remove as your would a file (
We’re deleting the object visible to Linux here, not the folder in Windows.