0

So I wrote a small program that calculates the Fibonacci sequence in the C programming language and wanted to move the fibo.c file to my regular C drive. The thing is I wrote it using Nano in Ubuntu running on the Windows Subsystem for Linux. When I try using the cp command to copy the file to /mnt/c which is where my C drive is, I get the error: "cp: cannot create regular file 'mnt/c/fibo.c': Permission denied". Anyone know how to circumvent this?

Note: I also tried using 'sudo cp' as well.

  • 1
    Would you really want to put a user file into the C:\ root directory? Try copying to /mnt/c/Users/timgrindall. – G-Man May 19 '18 at 0:50
  • Extremely relevant: superuser.com/questions/1114341/… – Ramhound May 19 '18 at 0:52
  • G-Man: Good point. I tried moving it into my user directory and that worked fine. – timgrindall May 19 '18 at 0:55
-1

WSL mounts the Windows partition in /mnt/

https://ridicurious.com/2018/10/18/2-ways-to-copy-files-from-windows-10-to-windows-sub-system-for-linux/

  • 3
    If you read the full explanation of their problem, you'd know they already know where WSL mounts Windows. The problem is permissions, not "where is my C:\?" – udlp Aug 16 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.