Working with the Android file system often requires specifying the exact paths to folders - be it transferring data, setting up backups, or working with root directories via ADB or Termux. However, the path syntax in Android is different from what you're used to in Windows or Linux, which causes confusion. Where to look for the root folder? How to properly escape spaces in titles? Why doesn't the terminal see the file, although it definitely exists? These questions arise for users regardless of experience.
In this article we will look at 5 working methods registering the path to a folder in Android - from basic (via a standard file manager) to advanced (commands adb pull or scripts in Termux). We will pay special attention access rights, since even the correct path will not work if the application does not have permission to read the directory. And for those who work with custom firmware or rooted deviceswe will give examples of accessing hidden system folders that are usually inaccessible.
๐น Important: The instructions in the article are relevant for Android 10โ14. On devices with MIUI, ColorOS or One UI there may be additional restrictions due to manufacturers' shells.
1. Basic syntax of paths in Android: what you need to know
Before writing paths, let's understand their structure. In Android it is used UNIX-like file system, where the separator is a forward slash / (unlike the reverse \ in Windows). The root directory is designated as /and the paths are case sensitive - /sdcard/Download and /sdcard/download can be different folders.
Major system paths encountered users:
- ๐
/storage/emulated/0/โ "internal memory" (available without root). Contains foldersDCIM,Download,Picturesetc. - ๐ง
/data/data/- application data (requires root or ADB with rights). Settings, cache and app databases are stored here. - ๐ฅ๏ธ
/system/โ system files (read-only without root). Includes/system/app(pre-installed applications) and/system/bin(executable files). - ๐๏ธ
/sdcard/- symbolic link to/storage/emulated/0/(outdated but supported path).
๐ก Feature: Starting with Android 11, Google has tightened policy Scoped Storage, limiting direct access of applications to folders of other apps. For example, a file manager will not be able to read /data/data/com.whatsapp/ without root access, even if the path is correct.
โ ๏ธ Attention: Paths like/mnt/or/dev/relate to low-level partitions. Changing them without understanding can lead to data loss or device bricking (especially on devices with an unlocked bootloader).
2. Method 1: Copying the path through a file manager
The simplest method is to use a built-in or third-party file manager (for example, Solid Explorer, FX File Manager or MiXplorer). Most of them allow you to copy the full path to the folder to the clipboard.
Instructions:
- Open the file manager and go to the desired folder (for example,
Download). - Click on the three dots (โฎ) in the upper right corner and select
PropertiesorInformation. - Find the line with the full path (for example,
/storage/emulated/0/Download/Music) and copy it.
๐ Example: If you need to specify the path to the screenshots, it will look like this:
/storage/emulated/0/Pictures/Screenshots/
Some managers (for example, Total Commander) show the path in the navigation bar - you can select it and copy it directly.
โ๏ธ Checking the path is correct
3 Method 2: Manually specifying the path in ADB
Android Debug Bridge (ADB) is a powerful tool for working with the file system via the command line. To copy files from a device to a PC or vice versa, you need to correctly enter the paths in the commands adb pull and adb push.
๐น Syntax:
adb pull /path/on/device. C:\folder\on\pc
adb push C:\file\on\pc /path/on/device
Command examples:
- ๐ฅ Copy all photos from device to PC:
adb pull /storage/emulated/0/DCIM/ C:\Backup\Photos\ - ๐ค Upload APK file to the folder
Download:adb push app.apk /storage/emulated/0/Download/ - ๐ View the contents of the folder
/sdcard/:adb shell ls /storage/emulated/0/
โ ๏ธ Attention: If the commandadb pullreturns an errorPermission denied, then the application does not have permission to read this folder Solutions:
- Use
adb root(requires unlocked bootloader and root).- Copy files via TWRP (if installed).
- Change access rights via
chmod(only for advanced users).
4 Method 3: Working with paths in. Termux
Termux is a terminal emulator for Android that allows you to execute Linux commands directly on the device. To work with files, you first need to access the storage:
๐ง Setting up Termux:
- Install Termux from F-Droid (version from Google Play is outdated).
- Run the command to access the repository:
termux-setup-storageThis will create a folder
~/storage/shared/that leads to/storage/emulated/0/. - Update packages:
pkg update && pkg upgrade
๐ Command examples:
| Task | Command | Example output |
|---|---|---|
Go to folder Download |
cd ~/storage/shared/Download |
(blank output on success) |
| View files | ls -l |
-rw-r--r-- 1 u0_a123 2023-10-01 file.txt |
| Create folder | mkdir ~/storage/shared/NewFolder |
(empty output) |
| Copy file | cp file.txt ~/storage/shared/Backup/ |
(empty output) |
๐ก Tip: To avoid entering long paths manually, use key completion Tab. For example, type cd ~/st and press Tab โTermux will automatically complete to ~/storage/.
If Termux does not see the command termux-setup-storage, update it via pkg update or install the add-on pkg install termux-api.
5. Method 4: Paths in system settings and applications
Some applications (for example, media players or backup utilities) require manually specifying folder paths:
๐ต Media players (VLC, Kodi):
- ๐ฝ๏ธ To add a folder with movies, specify a path like:
/storage/emulated/0/Movies/or (for an external memory card):
/storage/1234-5678/Movies/where
1234-5678โ unique identifier SD cards. - ๐ For music it is often used:
/storage/emulated/0/Music/
๐ฑ Backup utilities (Titanium Backup, Swift Backup):
- ๐ฆ Path for saving backups (if there is no root):
/storage/emulated/0/TitaniumBackup/ - ๐ For backup copies with root access:
/data/media/0/Backup/
โ ๏ธ Attention: Applications like Titanium Backup may not see folders on the SD card if it is formatted as portable storage (and not as internal memory. In this case, use the path/storage/1234-5678/where1234-5678โ Card ID (you can find it out throughadb shell ls /storage/).
How to find the ID of an external SD card?
Connect the device to the PC and run the command:
adb shell ls /storage/
The output will contain folders like 1234-5678 (for SD) and emulated (internal memory).
6. Method 5: Working with paths in custom firmware and root
On devices with an unlocked bootloader. data-i="180">root access and root access (for example, through Magisk) access to system folders is opened. However, it is important to understand permission hierarchy and risks of changes.
๐ง Key commands for root:
- ๐ Viewing hidden folders:
suls /data/data/ - ๐ Changing access rights (for example, for a file
hosts):suchmod 644 /system/etc/hosts - ๐ Copying system files:
sucp /system/app/Chrome/Chrome.apk /storage/emulated/0/Backup/
โ ๏ธ Dangerous operations:
- ๐ซ Removing files from
/system/can lead to loss of device functionality. - ๐ Changing files in
/data/dalvik-cache/will cause application cache failure. - ๐ Editing
/system/build.propwithout backup is fraught bootloop (loop loading).
โ ๏ธ Attention: On devices with Dynamic Partitions (Android 10+) the structure of the sections may differ. For example, instead of/systemyou will see/system/system. Before working with such devices, check the current structure through:su
ls -l /dev/block/by-name/
-->su
dd if=/dev/block/by-name/system of=/storage/emulated/0/system_backup.img
7. avoid
Even experienced users encounter problems when working with paths in Android. Let's look at the most common errors and their solutions:
๐ Error 1: "No such file or directory"
- ๐ Reason: A typo in the path, invalid case or folder does not exist.
- ๐ ๏ธ Solution: Check the path in parts. For example, instead of:
cd /storage/emulated/0/Downloads/NewFolderperform step by step:
cd /storage/emulated/0/ls
cd Downloads/
ls
๐ Error 2: "Permission denied"
- ๐ Reason: No access rights to the folder (especially important for
/data/or/system/). - ๐ ๏ธ Solution:
- For
/data/: useadb rootor root access. - For
/storage/emulated/0/: check that the file manager has permission to access the storage.
- For
๐ Error 3: Paths with spaces or special characters
- ๐ Reason: Spaces or characters like
&,$violate the command syntax. - ๐ ๏ธ Solution: Escape spaces with a backslash
\or put the path in quotes:cd /storage/emulated/0/My\ Folder/# or
cd "/storage/emulated/0/My Folder/"
๐ Useful command for diagnostics:
adb shell "ls -l '/storage/emulated/0/Folder with spaces/'"
FAQ: Answers to common questions questions
๐น How to find the full path to a file if the file manager does not show it?
Use Termux or ADB:
- Go to the folder with the file through the terminal.
- Run
pwd(print working directory) - this will show the current path. - For a file, use
realpath file_name.
Example:
cd ~/storage/shared/Download
realpath myfile.txt
Output: /storage/emulated/0/Download/myfile.txt
๐น Why does the path /sdcard/ not work in new versions of Android?
Starting with Android 10, /sdcard/ is a symbolic link to /storage/emulated/0/. applications and commands may not follow symlinks. Always use the full path /storage/emulated/0/... for reliability.
Exception: in TWRP or ADB sideload /sdcard/ may work, since a different permission context is used there.
๐น Is it possible to access another user's folder (for example /data/user/10/)?
No, without root access. Android isolates user data (including work profiles). Even with root, access to other people's data may be limited SELinux.
If you have multi-user device (for example, a tablet with multiple accounts), use:
surun-as u10_com.example.app
ls /data/data/com.example.app/
where u10_ โ prefix for user with ID 10.
๐น How to copy files from /data/data/ without root?
Methods without root:
- ๐ฑ Use
adb backup(outdated method, but works on some devices):adb backup -f backup.ab com.example.appFile
backup.abcan be opened using abe (Android Backup Extractor). - โ๏ธ If the application supports export (for example, WhatsApp), use the built-in backup function in Google Drive.
- ๐ For some applications (for example, Kodi), you can redirect the data storage to an accessible folder through the settings.
โ ๏ธ Limitation: adb backup does not copy all data (for example, cache or settings of some applications).
๐น Why did the old paths stop working after updating Android?
Most likely, it's to blame Scoped Storage (starting with Android 10) or changes in SELinuxManufacturers can also introduce their own restrictions (for example, Xiaomi blocks access to some folders even through ADB).
Solutions:
- Update the file manager or utility (for example, Solid Explorer regularly adapts to new versions of Android).
- Use Shizuku + ADB to bypass some restrictions.
- For developers: request permission
MANAGE_EXTERNAL_STORAGE(but Google limits its issuance).