Priyanshu Sharma
Priyanshu Sharma

Reputation: 68

Cannot create file on ubuntu bash shell in my window machine

when I was try to use touch command on my ubuntu bash shell and in my Desktop folder /mnt/c/Users/Public/Desktop$ it give me this touch: cannot touch 'test.txt': Permission denied error.

Upvotes: 0

Views: 2556

Answers (1)

Raman Sailopal
Raman Sailopal

Reputation: 12877

You may not have access to the /mnt/c/Users/Public/Desktop directory as default

Run:

ls -ld /c/mnt/Users/Public/Desktop

to see whether you have write permissions as default. If you don't run:

sudo chmod +w /mnt/c/Users/Public/Desktop

This will then allow you write permissions to the directory and allow you to create files.

NOTE - Please ensure that the initial bash executable is run as administrator at Windows level

Upvotes: 1

Related Questions