Ubuntu – files saved when created in a WSL terminal window

bashcommand linewindows-subsystem-for-linux

I recently installed Ubuntu in WSL on my Windows 10 system following the steps at How to install Windows Subsystem for Linux (WSL) on Windows 10 | Windows Central. 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?

Best Answer

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

Related Question