Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy files from Windows 10 to WSL? [closed]

Tags:

windows

wsl-2

I want to process a file that resides on Windows using WSL. How do I move/copy the file from Windows to the WSL environment?

Linux Distribution installed for WSL: Ubuntu The file is in Desktop.

like image 748
xMERLION Avatar asked Apr 21 '21 15:04

xMERLION


People also ask

How do I transfer files between Windows and WSL?

To copy the file in Windows, right-click on it and select copy: Paste it in the Windows directory where you want to transfer the file. (I have pasted it into the “Documents” directory of Windows.

How do I copy a folder from Windows to WSL?

First, find where your current Windows is mounted within WSL. This will result with $path being a WSL mount path like /mnt/C/Users... Now you can use this variable to run wsl -e to point it to the mounted folder and move files to the native folder structure like `/home/me'.

How do I transfer files from Windows 10 to Linux?

4 Ways to Transfer Files From Windows to LinuxSecurely copy files via SSH. Windows to Linux file transfer with FTP. Share data using sync software. Use shared folders in your Linux virtual machine.


1 Answers

There are two methods mentioned in this website.

I prefer method 2, so will be summarising this method only.

Open your linux distribution, in my case, it is Ubuntu 20.04 LTS.

I find my file in the following path:

cd /mnt/c/Users/<username>/Desktop - /mnt/c is the Windows' C Drive mounted to Linux.

Then copy the file into my WSL's home directory:

cp <filename> ~/

Now go to the WSL's home directory and you can find the file there.

cd ~/
like image 177
xMERLION Avatar answered Oct 28 '22 15:10

xMERLION