0

On a Windows running computer, can we access files stored on the computer via the WSL (Windows Subsystem for Linux) ?

For example I'm using the Ubuntu WSL version on my Windows 10 computer. Using Ubuntu WSL, can I run a cat command on a text file stored in My Documents on the C: disk ?

3
  • What version of Windows are you running. If this is possible entirely depends on the version your running – Ramhound Nov 16 '19 at 1:40
  • If it helps, I know it's possible using RDP. Griffon's IT Library created an automated script I've been using for 2yrs to auto-configure RDP on Ubuntu Hyper-V VMs with xrdp. – JW0914 Nov 16 '19 at 2:58
  • 1
    Here is a WSL FAQ blog post: docs.microsoft.com/en-us/windows/wsl/… – Biswapriyo Nov 16 '19 at 13:55
1

In modern versions of Ubuntu WSL, Windows system drives are mounted under /mnt/ on the Linux filesystem. e.g. C:\Users\test\test.txt --> /mnt/c/Users/test/test.txt

If you wanted to cat out a file stored under C:\[USER-NAME]\Documents\[FILE-NAME], you could run cat /mnt/[USER-NAME]/Documents/[FILE-NAME] in WSL.

2
  • You might want to define what "modern versions" of WSL are exactly. – Ramhound Nov 16 '19 at 12:50
  • @Ramhound Valid, but I'm not sure how to do research into that. Would you suggest me use alternate vocabulary instead? – ifconfig Nov 16 '19 at 23:53

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