Ubuntu – How to navigate to C drive in bash on WSL-Ubuntu?

command linewindows-subsystem-for-linux

I've installed bash on Ubuntu on Windows feature on Windows 10 and I want to change directory this path on my C:\ drive:

C:/wamp64/www 

What should I do ?

Best Answer

In Windows Subsystem for Linux (WSL) The C:\ drive is mounted as /mnt/c/, D:\ is mounted as /mnt/d/ et cetra. Therefore, C:/wamp64/www should be at /mnt/c/wamp64/www. Try:

cd /mnt/c/wamp64/www

in the Ubuntu terminal to go to that folder. Note, the first / before mnt and remember that in Ubuntu file and folder names are case sensitive. So wamp64, WAMP64, wAmP64, and WaMp64 are 4 different folders! See https://superuser.com/questions/1116625/how-can-i-access-case-sensitive-paths-on-windows-created-with-bash-on-ubuntu-on for a bit more on using case sensitive file names in WSL.

References:

https://blogs.msdn.microsoft.com/wsl/2016/06/15/wsl-file-system-support/

https://superuser.com/questions/1066261/how-to-access-windows-folders-from-bash-on-ubuntu-on-windows

Hope this helps