Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In termux android ls: cannot open directory '.': Permission denied?

Tags:

android

ls

enter image description here

'''ls: cannot open directory '.': Permission denied'''

like image 593
Saurabh Bedre Avatar asked Sep 07 '25 00:09

Saurabh Bedre


2 Answers

beside the instruction other people mentioned:

  • Go to Settings → Apps → All Apps → Termux → Permissions. Grant the permission to access the storage. After that, you shouldn't get this error for shared storage.
  • run termux-setup-storage

you may also need to do it as a root user.

like image 198
xnsxsnx Avatar answered Sep 10 '25 02:09

xnsxsnx


To get the list of files and folders using 'ls' command, it is necessary to have permission of storage first. And as termux app does not have storage permission option in settings, so, we have to run the command
termux-setup-storage
and provide the permission for termux app.
After restarting the app, the command runs perfectly.

like image 45
Prakash pratap Singh Avatar answered Sep 10 '25 02:09

Prakash pratap Singh