linux subsystem on windows, how to set working directory to a folder on windows?

linux subsystem on windows, how to set working directory to a folder on windows?

Problem Description:

I am trying to import a file on windows 11 to a linux subsystem (Ubuntu 22.04.1) while it is connected to docker. I am new to this so I am sorry if I am making obvious mistakes. To my understanding (I am following this tutorial:, I need docker running first and then open my linux subsystem. However once I get to cd then it gives me the following error: -bash: cd: too many arguments. What I need to do is set the working directory to a specific folder so I can proceed with the next step.

typing pwd simply showed me that I am in home(username I created when installing the linux subsystem)

I am new to linux and docker so an easy to understand answer is greatly appreciated.


I have tried cd and then name of path for example E:UsersNameDesktopfolder onefolder twofolder where file is and I got -bash: cd: too many arguments. I also changed to / and got the same error. I thought it would set the working directory (folder where file is).

Docker is connected to linux subsystem as I did the hello-world test successfully

Solution – 1

Linux does not know about drives, there are only directories. Generally, a WSL mounts windows drives, which means you can find them under /mnt: generally you should have /mnt/c for your C:-drive, please check if you can access /mnt/e for accessing your E:-drive.

Your directory should be accessible from:

cd /mnt/c/Users/Name/Desktop/"folder one"/"folder two"

Good luck

Rate this post
We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.