1
0 Comments

I am currently configuring and setting up my Windows Subsystem for Linux (WSL) on my Windows 10 workstation to use command line tools. Both WSL and Git Bash allow access to all drives, partitions, and files on the PC (for the user’s access), but the file paths are different. For example, I have a temp directory with some files in it.

tree C:\Temp
C:\TEMP
├───tempfile1.txt
├───tempfile2.txt
└───tempfile3.txt

When I open Git Bash (by following this StackOverflow question and answer), navigate to the C:\Temp directory, and run the “pwd” command, I see the path as.

/c/Temp

However, when I run the “ls” command in the root directory of Git Bash, I don’t see a “c” directory or a “mnt” directory. On the other hand, when I use the “Open Linux Shell here” option in the right-click menu in Windows Explorer to open WSL, and run the “pwd” command, it shows the path as being.

/mnt/c/Temp

I am wondering what and where the root directory “/” is in Windows, and if these are just two different ways of mimicking the root directory.

Note: The Windows version used is Windows 10 Enterprise Edition Version 1903 (Build 18362.267) and the WSL version is 1809 (Build 17763) (latest at the time of writing).

Askify.me Answered question January 30, 2023