Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change working directory in Termux

Tags:

android

termux

Im running Termux on an Android 10 smartphone. Termux is fully upgraded and updated. But I can't access device storage(/storage/emulated/0). I tried 'cd' command, and it works. But whenever I try to access a file or folder it says 'no access'. Plz help me.

like image 786
Crazy Thinker Avatar asked Oct 19 '25 18:10

Crazy Thinker


2 Answers

For accessing to shared storage (/sdcard or /storage/emulated/0), Termux needs a storage access permission. It is not granted by default and is not requested on application startup because it is not necessary for normal applications.

In order to have access you should run

termux-setup-storage

command. Then you can have access to various paths like :

  • ~/storage/shared : this is the root of shared storage
  • ~/storage/downloads : this is the common folder for downloads
  • ~/storage/dcim : this is normal directory for pictures and vidoes captured by camera
like image 86
Hadi Hosseinpour Avatar answered Oct 21 '25 09:10

Hadi Hosseinpour


  1. Setup your phone internal storage in termux, using this command:

    termux-setup-storage
    
  2. Change your directory using this command:

    cd /sdcard
    

Now you can easily access your internal storage.

like image 36
Krypton-X Avatar answered Oct 21 '25 09:10

Krypton-X