1

I am using Ubuntu on windows 10 and I need to move a file from a windows folder into ubuntu folder using the git bash terminal.

How would I do this?

estherwn
  • 156
  • 6
Llewellyn Hattingh
  • 306
  • 1
  • 5
  • 16

2 Answers2

3

Actually, I'm not sure why, but you cannot move a folder from windows to WSL. It causes permission denied error on removing process (moving consists of copy & remove). But you can copy it instead using BASH.

Steps :

  1. Put your folder in User Directory (ex. C://Users/Admin/)
  2. Open your ubuntu terminal
  3. Copy it recursively. Ex :
cp -r /mnt/c/Users/Admin/AFolder ./FolderInWSL/
tlentali
  • 3,407
  • 2
  • 14
  • 21
Arba
  • 95
  • 9
1

You should move the file from within Ubuntu, not the other way around, because if you copy from Windows to Ubuntu, you will run into permissions errors.

Sources:

See this for the solution: Copy Files from Windows to the Ubuntu Subsystem

So the moving would be from within the ubuntu shell something like:

mv /mnt/<windows_drive_letter>/<path>/<filename> .
estherwn
  • 156
  • 6