89

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.?

151

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 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
  • 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 PC\PhoneName" – 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
12

Alternatively,

  1. Hold down Shift while right-clicking in your desired Windows directory
  2. Select "Open PowerShell window here"

PowerShell Context Menu

  1. 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.

  1. Hold down Shift while right-clicking in your desired Windows directory
  2. 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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.