There are so many files on my Android device that I can’t remember where I have saved them.
Solution
Here is my simple solution. 1- Install Termux app. 2- Use find command to list them all. The below command will list them all in a text file which allows me to search and locate them easily.
The find command
find /storage/emulated/0/ > /storage/emulated/0/phonelist.txt
On newer Android versions, some directories are not accessible by user’s app. But it is OK.
find: ‘/storage/emulated/0/Android/data’: Permission denied
find: ‘/storage/emulated/0/Android/obb’: Permission denied
Bash function
If you use this often, you can make a bash function in your Termux ~/.bashrc
or ~/.zshrc
. For example:
function lsphone() {
DDDD=$(date -Idate)
echo 'Listing...'
find /storage/emulated/0/ > /storage/emulated/0/localhost/resources/phonelist/phone$DDDD.txt
echo "Done! \nCheck /storage/emulated/0/localhost/resources/phonelist/phone$DDDD.txt"
}
my one
I also made a python full text search app to search files on my phone. So I use the below function.
function lsphone2() {
DDDD=$(date -Idate)
echo 'Listing..., please wait...'
find /storage/emulated/0/ -type f > /storage/emulated/0/localhost/resources/phonelist/phone$DDDD.txt
# add <br> before each file path
sed -i -e "s~/storage/emulated/0/~<br><br>/storage/emulated/0/~g" /storage/emulated/0/localhost/resources/phonelist/phone$DDDD.txt
echo "Done listing! \nCheck /storage/emulated/0/localhost/resources/phonelist/phone$DDDD.txt"
echo 'Deleting indexed old sqlite3 in: /storage/emulated/0/localhost/indexed_database/phonelist.sqlite3'
rm -rf /storage/emulated/0/localhost/indexed_database/phonelist.sqlite3
echo "----\n"
echo "Done all"
}