Hey there, today we'll discuss how we can search for files created while using "Ubuntu on windows" feature of Windows 10/11. If you've already configured how to use ubuntu from your windows system, you can skip below steps.
How to use Ubuntu in your Windows system.
Step 1: Open powershell & Run as Administrator
Step 2: Type in below command wsl --install
& wait for the process to complete.
Step 3: Download Ubuntu from Windows Store
Step 4: Type the command wsl --install -d ubuntu
. This will install WSL & Ubuntu in your system
Step 5: Restart your system
Step 6: Now, you need to create a username & password for Ubuntu setup. You can leave blank for password, if you don't want to retype your password again & again
Step 7: Now, you need to update & upgrade your ubuntu. Type the following commands - sudo apt update
& then sudo apt upgrade
Step 8: Now, you might need to check below 2 options from the 'Turn windows features on or off' - Virtual Machine Platform & Windows Subsystem for Linux.
Source - https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#1-overview
Now, let's say you're using this Ubuntu on Windows & created some files/folders. You might need to check'em or copy them too for future. How will you get them? If you google search about this question, you'll get below answer:
The Ubuntu files installed through the Windows Subsystem for Linux (WSL) are stored in the "AppData" folder in Windows 10. The full path to the folder is usually something like "C:\Users{username}\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_{random_characters}\LocalState\rootfs". It is recommended that you use the Ubuntu terminal to interact with the Ubuntu files and applications, rather than modifying the files directly through Windows File Explorer.
Source - https://qr.ae/pKAFBO
But this won't work in many cases. I've got a solution to this actually.
Where do our files resides if using 'Ubuntu on Windows'?
Step 1: Type the following text at the address bar of windows explorer - \\wsl$
& hit Enter
Step 2: Navigate to root/home/username/
Step 3: You'll get all the files/folders you've created here
Source - https://stackoverflow.com/a/74059809/10957470
In case you're facing any issues, feel free to ping me on LinkedIn, Instagram or Mail. You can also checkout my portfolio.
HAPPY HACKING !!
Top comments (0)