MVF - Move Files between Windows and WSL easily
Posted by Dannskkk@reddit | linux | View on Reddit | 7 comments
https://github.com/mdanishharoon/mvf
mvf
(Move File) is a fast, shell-agnostic command-line utility for the Windows Subsystem for Linux (WSL) that simplifies moving files and directories between the Windows and WSL filesystems. so moving files can be as simple as the following :
To move archive.zip
from your WSL home directory (~
) to your Windows Documents folder:
# Usage: mvf to-win <wsl_path> <windows_relative_path>
mvf to-win archive.zip Documents/
I always thought it was clunky trying to move files between wsl and windows and there was no way to do it easily from the command line without either having to run explorer.exe and manually dragging files around or by typing out paths like /mnt/c/Users/YourUser/...
this is why i made this tool. Feel free to check out the github repo and give any advice to further improve this.
i initially wrote a simple bash script for this but a friend pointed out that i should make it shell agnostic and so now i rewrote the script in C, and used system calls instead of bash to avoid shell specific features entirely
Mooks79@reddit
Bearing in mind the c drive is automatically mounted in wsl to mnt/c - what’s the benefit of this?
Dannskkk@reddit (OP)
eliminates the need to type long paths like /mnt/c/Users/YourName/Downloads/file.txt - instead you just use
mvf to-wsl "Downloads/file.txt" "docs/".
CMDR_Shazbot@reddit
Pointless. Just made a symlink to my users home folder. mv file ~/c/Downloads
ThomasterXXL@reddit
If the guy's willing to over-engineer a ridiculous solution to a simple problem, then I'd love to see a virtual file system or eBPF module that intercepts all file opens, writes and reads to the user's home directory to redirect .dotfiles in the home directory into a dotfile subdirectory, so you can COME BACK HOME. Whatever happened to Seo Taiji? ..... Oh no, he turned out to be a predator who grooms girls half his age to marry them and isolate them from the rest of the world.
No_Internet8453@reddit
I just read through the source code, and this does also scream of being vibe-coded
Mooks79@reddit
But you can do that with some basic symlinks, rather than installing an additional program, right?
NoctisFFXV@reddit
Or you know, go into the Linux folder that is automatically mounted in file explorer and copy files through GUI