60

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 ?

1
  • problem is that i dont know how to write C drives path... should i write it like C:/the/directory
    – Dr. Doof
    Aug 4, 2017 at 13:07

1 Answer 1

104

C:\ in Windows is /mnt/c/ in WSL Ubuntu

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.

Background on /mnt

Windows users not familiar with Ubuntu (Linux in general) may wonder:

What does /mnt stand for?

In Linux almost everything is a file or a folder. /mnt is a folder, /mnt/c is a folder called c inside the folder /mnt.

In Linux partitions (Windows calls them "drives" to confuse us) are mounted in folders generally called "mount points". So in WSL, the "C Drive" is mounted in the c folder inside /mnt folder. /mntis a folder within which other folders are created for the purpose of mounting various partitions. See the link related to mnt below.

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

On mnt

https://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/mnt.html

Hope this helps

4
  • I memorize the commands when I understand them more -> /mnt/c/ this mnt what dose it stand for? May 27, 2021 at 17:14
  • 3
    @YousefAltaf in Linux almost everything is a file or a folder. /mnt is a folder, /mnt/c is a folder called c inside the folder /mnt. Partitions (Windows calls them "drives" to confuse us) are mounted in Linux in folders. So the "C Drive" is mounted in the c folder inside /mnt folder. /mnt is a folder within which other folders are created for the purpose of mounting various partitions.
    – user68186
    May 27, 2021 at 17:44
  • Right Partitions (Windows calls them "drives" to confuse us) thanks for explanation May 27, 2021 at 19:00
  • worked for me, thank you Feb 23, 2022 at 11:01

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