Imagine your phone is like a house, and each app you install is like a guest in that house. Now, some apps, like Termux, might need access to a shared storage area, where files are kept, similar to a shared closet in the house.
But, just like how you wouldn’t want every guest to have access to every room in your house, your phone doesn’t automatically give every app access to shared storage. Instead, it asks for permission first.
Termux doesn’t need access to shared storage all the time, so it doesn’t ask for permission right away. It only asks for permission when you try to do something that requires it, like saving or accessing files.
Once you give Termux permission to access shared storage, it’s like giving a guest a key to that shared closet. Then, Termux can do what it needs to do with files, just like a guest can use the shared closet when they have the key.
So, it’s like giving permission for Termux to access a special storage area when it needs it!
Tutorial
termux-setup-storage
copy above command then click on open termux then just paste command and hit enter or you can type termux-setup-command manually in termux.
after above command termux will prompt dialogue for storage permission access like below screenshot then you need to press on ALLOW for access storage permission.
Successfully granted permission !
now you can access storage files in termux, you can refer below screenshot about how to access storage or shared folder if you don`t familiar with ls and cd command then paste below easy command.
cd $HOME/storage/ && ls
now you can access any storage folders or files by changing current directory like below command will show download folders and files list in terminal you can same command used for access dcim, movies or music folder.
type cd {foldername} like cd downloads or cd dcim then type ls command for show available folders and files list in current folder. if you want to check download folders and files list and you don’t know about ls and cd commands then just paste below command in termux.
cd $HOME/storage/downloads && ls