How can I move files from the Windows partition to the WSL one?

Burks Tedold 0 Reputation points
2024-04-08T06:55:13.2633333+00:00

I installed Ubuntu through WSL is the Windows virtualisation tool. And I want to move some files from the memory partition is controlled by Windows to the partition is controlled by Ubuntu. I tried to do it through Bash using the

sudo cp <lc_disk>:\\<dir_with_files>\\<file.txt> \\wsl.localhost\\Ubuntu\\home\\<username_for_Ubuntu>\\<target_dir>

command. But the error is raised after running it:

cp: cannot stat <lc_disk>:\\<dir_with_files>\\<file.txt>: No such file or directory.

And I tried to replace \ with / but it didn't help: there is the same error.

How can I move my files?

SysInfo

WSL

WSL version: 2.1.5.0 Kernel version: 5.15.146.1-2 WSLg version: 1.0.60 MSRDC version: 1.2.5105 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.3374

Ubuntu

Distributor ID: Ubuntu Description: Ubuntu 22.04.3 LTS Release: 22.04 Codename: jammy

Windows for business Windows Client for IT Pros User experience Other
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.