Some Noticeable Information
To access the folder of your Linux distribution, follow these steps:
1. Open your Linux terminal in the Linux environment.
2. Enter the command "explorer.exe ." to launch the File Explorer and navigate to the Linux distribution's folder.
Alternatively, you can directly access the WSL folder by typing "\\wsl$" into the address bar of the File Explorer and then open the desired distribution folder.
Windows 10's May 2019 Update brought a secure and officially endorsed method to seamlessly access and manage your Linux files through File Explorer and other programs. Follow these steps to access your Windows Subsystem for Linux (WSL) files.
This approach offers a risk-free way to interact with Linux files, eliminating any potential file permission problems. However, it is important to note that modifying the actual files at their original location on your system is still not recommended.
It doesn't matter if you use WSL1 or WSL2. These commands all function exactly the same way.
Open WSL Files from Terminal
There are two ways to access your Linux files. First, the easy one. From within the Windows Subsystem for Linux environment you want to browse, run the following command:
explorer.exe .
This will launch File Explorer showing the current Linux directory — you can browse the Linux environment's file system from there.
Open the WSL Directory in File Explorer Directly
You can also access them directly at a \\wsl$ path. In File Explorer or any other Windows application that can browse files, navigate to the following path:
\\wsl$
You'll see the folders for all your installed Linux distributions, which are exposed as if they were network shares. For example, Ubuntu 22.04 usually is available at \\wsl$\Ubuntu-22.04.
Feel free to create a shortcut to this folder — for example, you could drag it to the Quick Access section in File Explorer's sidebar.
You can modify these files as you would any other file on your system. You have the freedom to use Windows tools, including Notepad which even supports Unix line endings. Feel free to create new files in the Linux folders, delete files, or perform any other actions you desire. Windows will ensure that nothing goes awry and that the file's permissions are correctly updated.
Editor's P/S
As a Gen Z fan, I am excited about the new possibilities that accessing Linux (WSL) files on Windows 10 offers. With this new feature, I can now easily access and manage my Linux files through File Explorer and other programs. This will make it much easier for me to work with my Linux files and to integrate them into my Windows workflow.
I also appreciate the fact that this new feature is secure and officially endorsed by Microsoft. This gives me peace of mind knowing that my files are safe and that I won't run into any problems. Overall, I think that this new feature is a great addition to Windows 10 and I'm looking forward to using it to its full potential.