I am a super newbie for Ubuntu and basically need Ubuntu for a Python package. I would like to run a Python file in say e:/username/folder1/folder2/python.py. I tried every method online and the only reply is bash: cd./e: No such file or directory. I am not sure whether it is because of the bash windows or virtualenv.

When I use bash on Ubuntu on Windows, ls, it says VIRTUALENV_DIR. cd, it says /home/username. The cd .. etc changes the directory a little, but not another drive, nor the folder I would like it to find.

7 Answers 7


WSL stores your Windows drives in the /mnt folder, with the name of the drive as a subfolder. For example your C:\ drive will be present at /mnt/c/ for you to use.

Keeping this in mind, you can swap to your specific folder like so:

cd /mnt/e/username/folder1/folder2
  • 2
    Sure you want to cd to a file? looks like cd /mnt/e/username/folder1/folder2/ makes more sense
    – dufte
    Commented Sep 30, 2016 at 5:58
  • @dufte Good catch. Yay for copy-paste!
    – Kaz Wolfe
    Commented Sep 30, 2016 at 5:59
  • for ubuntu 16.04, it is inside of /media folder
    – solfish
    Commented Aug 5, 2017 at 20:20

In windows explorer, navigate to e:/username/folder1/folder2/,

type bash and press Enter in the address bar, a bash window with path in e:/username/folder1/folder2/ will appear.

This also work with command cmd.



A utility called wslpath that is shipped with both WSL and WSL2 can translate Windows paths to WSL paths (or translate WSL paths to Windows paths). For example, the command wslpath 'E:\username\folder1\folder2' gives you the path in WSL /mnt/e/username/folder1/folder2.

By using the wslpath utility, I define the following function in my ~/.bashrc to quickly cd to Windows paths.

cdw() { local d=`wslpath "$1"`; cd "$d"; }

With this user defined function, I can easily cd to E:\username\folder1\folder2 by simply typing

cdw 'E:\username\folder1\folder2'

Remember to wrap the Windows path by single quotes if it contains backslashes.

Changelog: June 11, 2022 - Improve the cdw function to make it work for space-containing paths such as C:\Program Files.

  • 3
    Wow. Usually when I see a question this old with 5 answers already, and a new user comes along with an answer, it's pretty bad. But not this time! Bravo for providing an answer that actually contributes something useful that was not covered in the others! Commented Apr 25, 2021 at 2:44

Yes, you can do that. I used shift + right click to get "Open Powershell here" whichever directory you want to bash and run 'bash' command, then run as usual enjoy. This is same as using Ubuntu bash as it uses same Python packages in the Windows Powershell after using 'bash' command.

Note: On windows 10 latest update maybe April 2018 with WSL and developers mode enabled.


You can try doing this : cd E:/username/folder1/folder2/ and then run python python.py. It always works in my case on Windows machine running bash.


with this little script you can execute every command from the directory your Powershell is currently in. It only works if the drive is already mounted to /mnt/ in the subsystem. It doesn't work with network resources.

function tux {$dl = (pwd).Path | wsl eval "cut -c 1 | tr 'A-Z' 'a-z'"; $wd = (pwd).Path | wsl eval "cut -d : -f 2 | tr '\\' '/' 2> /dev/null" ; wsl eval "cd '/mnt/$dl$wd' && eval '$args'"}

after you have executed it, you can use it like this:

tux vim test.txt

To change directory from wsl to windows file system:

cd /mnt/c/

To change directory from windows (PowerShell) to wsl file system:

cd Microsoft.PowerShell.Core\FileSystem::\\wsl.localhost\Ubuntu\
  • Welcome to Ask Ubuntu! The information on cd /mnt/c was already covered in two other answers, including the accepted answer from six years ago. The additional information would probably be more suitable on another question, since it doesn't answer this particular question. But also note that it will only work on Windows 11. It will not work on Windows 10. Commented Oct 15, 2022 at 12:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .