In this guide, we will show you the steps to access your device’s Internal Storage via the cd command in Termux. This open-source terminal emulator for Android is among the most popular players in its domain. It gives you the platform to run the Linux environment on your Android device. You could execute numerous different types of Linux commands in Termux, from the basics of listing files/folders via ls to creating a new directory via mkdir and everything in between.
Moreover, there could be a few instances wherein you would want to direct Termux and change its working directory toward a particular file or folder present on your Internal Storage. Since the storage in Android doesn’t follow the generic naming convention, you might face a few issues while trying to access the internal storage via the cd command in Termux. But fret not as this guide will help you out. Follow along for the instructions.
How to Access Internal Storage via cd command in Termux
- To begin with, grant storage access to Termux. For that, go to Settings > Apps > Termux > Select Files under Not Allowed > Change it to Allow.
- The Internal Storage in Android is named /storage/emulated/0. So you should it along with the cd command to change the directory to your Internal Storage, as follows:
cd /storage/emulated/0
- You could then bring up a list of files and folders on your Internal Storage via the ls command, as shown in the below screenshot.
- Let’s now access a file named Shizuku APK file which is present inside the Internal Storage > Download folder. The command for that will be:
cd /storage/emulated/0/Download
- Now use the ls command to bring up a list of all files and folders present in the Downloads folder, one of which will be the Shizuku APK file.
- If you want to install an APK file directly from Termux, then you’ll have to root your device.
- Once done, download and install a root-supported file manager, such as Solid File Explorer.
- Now transfer that app to the below location:
/data/local/tmp
- Finally, execute the below command to install the app:
su -c pm install /data/local/tmp/appname.apk
So these were the steps to access your device’s Internal Storage via the cd command in Termux. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.
Qwert
Hi Sadique,
thanks for your tutorial. I am able to cd into the `Internal storage > Download` folder. When I do `ls` inside `Downloads`, the folders I see match with what I expect, but I don’t see any files, even though I have some .pdf and .jpg files there. Do you have any idea what could be the issue?
device: Galaxy A54 5G
One UI version 6.1
Android version 14
Termux: latest from Play Store, installed 2024-07-30
Sadique Hassan
Grant the Storage [Files] access to the Termux app and then let me know the results.