5

I recently installed Ubuntu in WSL on my Windows 10 system following the steps at https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10. I created files in a Terminal window but I don't know how to access them via folder. How can I find and open such a file?

5

Method 1

While in the Ubuntu terminal enter:

explorer.exe . 

Note the . at the end. This will open a File Explorer window where you are at in Ubuntu.

enter image description here

Method 2

Open File Explorer in Windows the usual way:

enter image description here

Then at the top type:

\\wsl$\Ubuntu\home\<Your Ubuntu Username>

enter image description here

Source: https://winaero.com/blog/access-wsl-linux-files-file-explorer-windows-10/

Note: Text files created in Ubuntu uses different conventions for new lines as compared with Windows. If you edit these files using Windows tools they may not work as before in Ubuntu. Messing with Ubuntu system files via Windows Explorer may corrupt those files.

Warning

Do not change Linux files using Windows apps and tools

DO NOT, under ANY circumstances, access, create, and/or modify Linux files inside of your %LOCALAPPDATA% folder using Windows apps, tools, scripts, consoles, etc.

Opening > files using some Windows tools may read-lock the opened files > and/or folders, preventing updates to file contents and/or metadata, > essentially resulting in corrupted files/folders.

Creating/changing Linux files in your Appdata folder from Windows will likely result in data corruption and/or damage your Linux environment requiring you to uninstall & reinstall your distro!

Hope this helps

  • 2
    We've been told many times to never open a Linux file with a windows app because it can corrupt the data. There are many Linux programs the OP can use like 'ls, cat, cd, etc from the command line. Plus the OP can install nautilus and gedit if so inclined to use a GUI. There seems little point in installing Linux on Windows and turning around to use Windows to massage the Linux data. – WinEunuuchs2Unix Dec 7 '19 at 0:17
  • 1
    @WinEunuuchs2Unix Now I have a Warning section at the bottom of the answer based on Microsofts own blog. – user68186 Dec 7 '19 at 3:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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