How to access Windows folders from Bash on Ubuntu on Windows
On the Bash on Ubuntu on Windows app, I only have
root@localhost:~# ls -a
.bash_history .bashrc .profile
How do I access all of the Windows folders like Documents, Downloads, etc.?
bash windows-10 windows-subsystem-for-linux
add a comment |
On the Bash on Ubuntu on Windows app, I only have
root@localhost:~# ls -a
.bash_history .bashrc .profile
How do I access all of the Windows folders like Documents, Downloads, etc.?
bash windows-10 windows-subsystem-for-linux
add a comment |
On the Bash on Ubuntu on Windows app, I only have
root@localhost:~# ls -a
.bash_history .bashrc .profile
How do I access all of the Windows folders like Documents, Downloads, etc.?
bash windows-10 windows-subsystem-for-linux
On the Bash on Ubuntu on Windows app, I only have
root@localhost:~# ls -a
.bash_history .bashrc .profile
How do I access all of the Windows folders like Documents, Downloads, etc.?
bash windows-10 windows-subsystem-for-linux
bash windows-10 windows-subsystem-for-linux
edited Apr 16 '16 at 18:06
Ben N
29.9k1398145
29.9k1398145
asked Apr 16 '16 at 17:33
Sergei WallaceSergei Wallace
90421114
90421114
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You'll find the Windows C: structure at /mnt/c/ in the Bash environment.
Therefore, my Documents folder is at /mnt/c/Users/Ben/Documents/.
why does mnt not show up with ls -a?
– Sergei Wallace
Apr 16 '16 at 17:52
4
You were in the~directory, your home in the Bash environment, which is not the root (/). If you had donecd /first, you would have seenmnt.
– Ben N
Apr 16 '16 at 18:01
When it comes to building scripts, the 2nd sentence doesn't necessarily follow from the first. Windows lets you move your documents folder around all over the place. It would be nice to be able to read that info from the Windows registry or similar while using bash.
– Joel Coehoorn
Oct 6 '16 at 23:46
1
how can I access stuff outside C? for instance, I connected a phone via MTP and its files shows up at a path "This PCPhoneName"
– Michael
Dec 20 '16 at 16:47
1
@Michael Unfortunately, MTP devices are very unlike normal file systems. They aren't even accessible from a normal command prompt, so I don't know of a way to access them from BoUoW.
– Ben N
Dec 20 '16 at 17:05
|
show 5 more comments
Alternatively,
- Hold down Shift while right-clicking in your desired Windows directory
- Select "Open PowerShell window here"

- Once you're in PowerShell, type
bash
You'll be able to use any Bash commands directly to operate on the files and folders in that Windows directory. By using this method, you don't have to manually cd into your directories especially when you've a deep-rooted directory to access.
Update as of Windows 10 1809:
Above still works, but there's an easier method now.
- Hold down Shift while right-clicking in your desired Windows directory
- Select "Open Linux shell here"
1
In my right-clicked context menu, I don't see the item for Open PowerShell window here
– Yu Shen
Apr 24 '18 at 1:47
1
yep, same here.....
– Maksim Kniazev
May 13 '18 at 3:33
@YuShen Do ensure that you've the latest Windows 10 update installed. For instance, the current version is 1803 and it has the option. I realize some machines which weren't updated still has CMD as their default and hence does not have this option in the context menu.
– Keith OYS
May 27 '18 at 12:55
It doesn't work, the bash commands opens in default ubuntu user directory, not curret windows directory
– mxdsp
Oct 22 '18 at 16:44
@mxdsp What were your steps and your Windows version? Please detail it out for me so I could help you further. If you did it correctly, it would bring you into your current windows directory. Ain't wise downvoting just because it doesn't work for you.
– Keith OYS
Oct 23 '18 at 17:21
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1066261%2fhow-to-access-windows-folders-from-bash-on-ubuntu-on-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You'll find the Windows C: structure at /mnt/c/ in the Bash environment.
Therefore, my Documents folder is at /mnt/c/Users/Ben/Documents/.
why does mnt not show up with ls -a?
– Sergei Wallace
Apr 16 '16 at 17:52
4
You were in the~directory, your home in the Bash environment, which is not the root (/). If you had donecd /first, you would have seenmnt.
– Ben N
Apr 16 '16 at 18:01
When it comes to building scripts, the 2nd sentence doesn't necessarily follow from the first. Windows lets you move your documents folder around all over the place. It would be nice to be able to read that info from the Windows registry or similar while using bash.
– Joel Coehoorn
Oct 6 '16 at 23:46
1
how can I access stuff outside C? for instance, I connected a phone via MTP and its files shows up at a path "This PCPhoneName"
– Michael
Dec 20 '16 at 16:47
1
@Michael Unfortunately, MTP devices are very unlike normal file systems. They aren't even accessible from a normal command prompt, so I don't know of a way to access them from BoUoW.
– Ben N
Dec 20 '16 at 17:05
|
show 5 more comments
You'll find the Windows C: structure at /mnt/c/ in the Bash environment.
Therefore, my Documents folder is at /mnt/c/Users/Ben/Documents/.
why does mnt not show up with ls -a?
– Sergei Wallace
Apr 16 '16 at 17:52
4
You were in the~directory, your home in the Bash environment, which is not the root (/). If you had donecd /first, you would have seenmnt.
– Ben N
Apr 16 '16 at 18:01
When it comes to building scripts, the 2nd sentence doesn't necessarily follow from the first. Windows lets you move your documents folder around all over the place. It would be nice to be able to read that info from the Windows registry or similar while using bash.
– Joel Coehoorn
Oct 6 '16 at 23:46
1
how can I access stuff outside C? for instance, I connected a phone via MTP and its files shows up at a path "This PCPhoneName"
– Michael
Dec 20 '16 at 16:47
1
@Michael Unfortunately, MTP devices are very unlike normal file systems. They aren't even accessible from a normal command prompt, so I don't know of a way to access them from BoUoW.
– Ben N
Dec 20 '16 at 17:05
|
show 5 more comments
You'll find the Windows C: structure at /mnt/c/ in the Bash environment.
Therefore, my Documents folder is at /mnt/c/Users/Ben/Documents/.
You'll find the Windows C: structure at /mnt/c/ in the Bash environment.
Therefore, my Documents folder is at /mnt/c/Users/Ben/Documents/.
answered Apr 16 '16 at 17:39
Ben NBen N
29.9k1398145
29.9k1398145
why does mnt not show up with ls -a?
– Sergei Wallace
Apr 16 '16 at 17:52
4
You were in the~directory, your home in the Bash environment, which is not the root (/). If you had donecd /first, you would have seenmnt.
– Ben N
Apr 16 '16 at 18:01
When it comes to building scripts, the 2nd sentence doesn't necessarily follow from the first. Windows lets you move your documents folder around all over the place. It would be nice to be able to read that info from the Windows registry or similar while using bash.
– Joel Coehoorn
Oct 6 '16 at 23:46
1
how can I access stuff outside C? for instance, I connected a phone via MTP and its files shows up at a path "This PCPhoneName"
– Michael
Dec 20 '16 at 16:47
1
@Michael Unfortunately, MTP devices are very unlike normal file systems. They aren't even accessible from a normal command prompt, so I don't know of a way to access them from BoUoW.
– Ben N
Dec 20 '16 at 17:05
|
show 5 more comments
why does mnt not show up with ls -a?
– Sergei Wallace
Apr 16 '16 at 17:52
4
You were in the~directory, your home in the Bash environment, which is not the root (/). If you had donecd /first, you would have seenmnt.
– Ben N
Apr 16 '16 at 18:01
When it comes to building scripts, the 2nd sentence doesn't necessarily follow from the first. Windows lets you move your documents folder around all over the place. It would be nice to be able to read that info from the Windows registry or similar while using bash.
– Joel Coehoorn
Oct 6 '16 at 23:46
1
how can I access stuff outside C? for instance, I connected a phone via MTP and its files shows up at a path "This PCPhoneName"
– Michael
Dec 20 '16 at 16:47
1
@Michael Unfortunately, MTP devices are very unlike normal file systems. They aren't even accessible from a normal command prompt, so I don't know of a way to access them from BoUoW.
– Ben N
Dec 20 '16 at 17:05
why does mnt not show up with ls -a?
– Sergei Wallace
Apr 16 '16 at 17:52
why does mnt not show up with ls -a?
– Sergei Wallace
Apr 16 '16 at 17:52
4
4
You were in the
~ directory, your home in the Bash environment, which is not the root (/). If you had done cd / first, you would have seen mnt.– Ben N
Apr 16 '16 at 18:01
You were in the
~ directory, your home in the Bash environment, which is not the root (/). If you had done cd / first, you would have seen mnt.– Ben N
Apr 16 '16 at 18:01
When it comes to building scripts, the 2nd sentence doesn't necessarily follow from the first. Windows lets you move your documents folder around all over the place. It would be nice to be able to read that info from the Windows registry or similar while using bash.
– Joel Coehoorn
Oct 6 '16 at 23:46
When it comes to building scripts, the 2nd sentence doesn't necessarily follow from the first. Windows lets you move your documents folder around all over the place. It would be nice to be able to read that info from the Windows registry or similar while using bash.
– Joel Coehoorn
Oct 6 '16 at 23:46
1
1
how can I access stuff outside C? for instance, I connected a phone via MTP and its files shows up at a path "This PCPhoneName"
– Michael
Dec 20 '16 at 16:47
how can I access stuff outside C? for instance, I connected a phone via MTP and its files shows up at a path "This PCPhoneName"
– Michael
Dec 20 '16 at 16:47
1
1
@Michael Unfortunately, MTP devices are very unlike normal file systems. They aren't even accessible from a normal command prompt, so I don't know of a way to access them from BoUoW.
– Ben N
Dec 20 '16 at 17:05
@Michael Unfortunately, MTP devices are very unlike normal file systems. They aren't even accessible from a normal command prompt, so I don't know of a way to access them from BoUoW.
– Ben N
Dec 20 '16 at 17:05
|
show 5 more comments
Alternatively,
- Hold down Shift while right-clicking in your desired Windows directory
- Select "Open PowerShell window here"

- Once you're in PowerShell, type
bash
You'll be able to use any Bash commands directly to operate on the files and folders in that Windows directory. By using this method, you don't have to manually cd into your directories especially when you've a deep-rooted directory to access.
Update as of Windows 10 1809:
Above still works, but there's an easier method now.
- Hold down Shift while right-clicking in your desired Windows directory
- Select "Open Linux shell here"
1
In my right-clicked context menu, I don't see the item for Open PowerShell window here
– Yu Shen
Apr 24 '18 at 1:47
1
yep, same here.....
– Maksim Kniazev
May 13 '18 at 3:33
@YuShen Do ensure that you've the latest Windows 10 update installed. For instance, the current version is 1803 and it has the option. I realize some machines which weren't updated still has CMD as their default and hence does not have this option in the context menu.
– Keith OYS
May 27 '18 at 12:55
It doesn't work, the bash commands opens in default ubuntu user directory, not curret windows directory
– mxdsp
Oct 22 '18 at 16:44
@mxdsp What were your steps and your Windows version? Please detail it out for me so I could help you further. If you did it correctly, it would bring you into your current windows directory. Ain't wise downvoting just because it doesn't work for you.
– Keith OYS
Oct 23 '18 at 17:21
add a comment |
Alternatively,
- Hold down Shift while right-clicking in your desired Windows directory
- Select "Open PowerShell window here"

- Once you're in PowerShell, type
bash
You'll be able to use any Bash commands directly to operate on the files and folders in that Windows directory. By using this method, you don't have to manually cd into your directories especially when you've a deep-rooted directory to access.
Update as of Windows 10 1809:
Above still works, but there's an easier method now.
- Hold down Shift while right-clicking in your desired Windows directory
- Select "Open Linux shell here"
1
In my right-clicked context menu, I don't see the item for Open PowerShell window here
– Yu Shen
Apr 24 '18 at 1:47
1
yep, same here.....
– Maksim Kniazev
May 13 '18 at 3:33
@YuShen Do ensure that you've the latest Windows 10 update installed. For instance, the current version is 1803 and it has the option. I realize some machines which weren't updated still has CMD as their default and hence does not have this option in the context menu.
– Keith OYS
May 27 '18 at 12:55
It doesn't work, the bash commands opens in default ubuntu user directory, not curret windows directory
– mxdsp
Oct 22 '18 at 16:44
@mxdsp What were your steps and your Windows version? Please detail it out for me so I could help you further. If you did it correctly, it would bring you into your current windows directory. Ain't wise downvoting just because it doesn't work for you.
– Keith OYS
Oct 23 '18 at 17:21
add a comment |
Alternatively,
- Hold down Shift while right-clicking in your desired Windows directory
- Select "Open PowerShell window here"

- Once you're in PowerShell, type
bash
You'll be able to use any Bash commands directly to operate on the files and folders in that Windows directory. By using this method, you don't have to manually cd into your directories especially when you've a deep-rooted directory to access.
Update as of Windows 10 1809:
Above still works, but there's an easier method now.
- Hold down Shift while right-clicking in your desired Windows directory
- Select "Open Linux shell here"
Alternatively,
- Hold down Shift while right-clicking in your desired Windows directory
- Select "Open PowerShell window here"

- Once you're in PowerShell, type
bash
You'll be able to use any Bash commands directly to operate on the files and folders in that Windows directory. By using this method, you don't have to manually cd into your directories especially when you've a deep-rooted directory to access.
Update as of Windows 10 1809:
Above still works, but there's an easier method now.
- Hold down Shift while right-clicking in your desired Windows directory
- Select "Open Linux shell here"
edited Oct 12 '18 at 8:49
answered Oct 11 '17 at 5:14
Keith OYSKeith OYS
24126
24126
1
In my right-clicked context menu, I don't see the item for Open PowerShell window here
– Yu Shen
Apr 24 '18 at 1:47
1
yep, same here.....
– Maksim Kniazev
May 13 '18 at 3:33
@YuShen Do ensure that you've the latest Windows 10 update installed. For instance, the current version is 1803 and it has the option. I realize some machines which weren't updated still has CMD as their default and hence does not have this option in the context menu.
– Keith OYS
May 27 '18 at 12:55
It doesn't work, the bash commands opens in default ubuntu user directory, not curret windows directory
– mxdsp
Oct 22 '18 at 16:44
@mxdsp What were your steps and your Windows version? Please detail it out for me so I could help you further. If you did it correctly, it would bring you into your current windows directory. Ain't wise downvoting just because it doesn't work for you.
– Keith OYS
Oct 23 '18 at 17:21
add a comment |
1
In my right-clicked context menu, I don't see the item for Open PowerShell window here
– Yu Shen
Apr 24 '18 at 1:47
1
yep, same here.....
– Maksim Kniazev
May 13 '18 at 3:33
@YuShen Do ensure that you've the latest Windows 10 update installed. For instance, the current version is 1803 and it has the option. I realize some machines which weren't updated still has CMD as their default and hence does not have this option in the context menu.
– Keith OYS
May 27 '18 at 12:55
It doesn't work, the bash commands opens in default ubuntu user directory, not curret windows directory
– mxdsp
Oct 22 '18 at 16:44
@mxdsp What were your steps and your Windows version? Please detail it out for me so I could help you further. If you did it correctly, it would bring you into your current windows directory. Ain't wise downvoting just because it doesn't work for you.
– Keith OYS
Oct 23 '18 at 17:21
1
1
In my right-clicked context menu, I don't see the item for Open PowerShell window here
– Yu Shen
Apr 24 '18 at 1:47
In my right-clicked context menu, I don't see the item for Open PowerShell window here
– Yu Shen
Apr 24 '18 at 1:47
1
1
yep, same here.....
– Maksim Kniazev
May 13 '18 at 3:33
yep, same here.....
– Maksim Kniazev
May 13 '18 at 3:33
@YuShen Do ensure that you've the latest Windows 10 update installed. For instance, the current version is 1803 and it has the option. I realize some machines which weren't updated still has CMD as their default and hence does not have this option in the context menu.
– Keith OYS
May 27 '18 at 12:55
@YuShen Do ensure that you've the latest Windows 10 update installed. For instance, the current version is 1803 and it has the option. I realize some machines which weren't updated still has CMD as their default and hence does not have this option in the context menu.
– Keith OYS
May 27 '18 at 12:55
It doesn't work, the bash commands opens in default ubuntu user directory, not curret windows directory
– mxdsp
Oct 22 '18 at 16:44
It doesn't work, the bash commands opens in default ubuntu user directory, not curret windows directory
– mxdsp
Oct 22 '18 at 16:44
@mxdsp What were your steps and your Windows version? Please detail it out for me so I could help you further. If you did it correctly, it would bring you into your current windows directory. Ain't wise downvoting just because it doesn't work for you.
– Keith OYS
Oct 23 '18 at 17:21
@mxdsp What were your steps and your Windows version? Please detail it out for me so I could help you further. If you did it correctly, it would bring you into your current windows directory. Ain't wise downvoting just because it doesn't work for you.
– Keith OYS
Oct 23 '18 at 17:21
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1066261%2fhow-to-access-windows-folders-from-bash-on-ubuntu-on-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown