How to access your Linux (WSL) files in Windows 10

0
42


The Windows 10 May 2019 Update introduced an easy, secure, and officially supported way to access and work with your Linux files from File Explorer and other apps. Here’s how to access the Windows Subsystem for Linux (WSL) files.

Installing Ubuntu on Windows using ...
Installing Ubuntu on Windows using WSL (Windows Subsystem for Linux)

Unlike the previous methods, this is a safe way to work with Linux files! Windows does some magic in the background, allowing you to edit your Linux files from within Windows apps without causing file permission issues. You should not yet modify the underlying files in their actual location on your system.

Note: It doesn’t matter if you use WSL1 or WSL2. All of these commands work exactly the same way.

There are two ways to access your Linux files. First, the easy. From the Windows Subsystem for Linux environment that you want to explore, run the following command:

explorer.exe .

This will launch File Explorer showing the current Linux directory; from there, you can explore the file system of the Linux environment.

You can also access them directly in a \wsl$ path. In File Explorer or any other Windows application that can explore files, navigate to the following path:

\wsl$

You will see the folders of all your installed Linux distributions, which are exposed as if they were network shares. For example, Ubuntu 22.04 is usually available at \wsl$Ubuntu-22.04.

Feel free to create a shortcut to this folder; for example, you can drag it to the Quick Access section in the File Explorer sidebar.

Again, you can modify these files normally as if they were any other type of file on your system. Modify files with Windows tools (Notepad even supports Unix line endings!), create new files in Linux folders, delete files, or do anything else you want. Windows will make sure nothing goes wrong and the file permissions are updated correctly.

RELATED: Everything new in Windows 10 May 2019 Update, available now