This is from my Android mobile but moreover related to general Linux. I am using a terminal app similar to ubuntu which is installed in my mobile. I am doing copy of my files to laptop and some are being skipped randomly.
When doing ls dir
on few directories, files are not listed though I can see those are there and accessible via file manager.
I checked the permission of the directory, all normal. Other files inside another directories are being read by ls
and other binaries. All these are present in my home directory.
For example HDoc is a directory inside Download directory inside sdcard/internal-storage. Files are there inside HDoc but not being read by ls
or any other binary.
Even tried with sudo though my phone is not rooted so it is not real root.
$ cd sdcard
----- Other working directory permission -----
localhost:/sdcard$ ls -l Download/ | grep -i MAG
drwxrwx--- 2 root 9997 8192 Jun 17 18:49 MAG
localhost:/sdcard$ ls -l Download/MAG/
total 0
-rw-rw---- 1 root 9997 5562037 Feb 16 2021 1.jpg
-rw-rw---- 1 root 9997 2133364 May 29 2023 2.m4a
-rw-rw---- 1 root 9997 1019910 Aug 9 2023 3.png
-rw-rw---- 1 root 9997 671989652 Sep 25 2022 4.mp4
----- Non-readable directory (have files inside)-----
localhost:/sdcard$ ls -l Download/ | grep HDoc
drwxrwx--- 2 root 9997 4096 Jul 8 2023 HDoc
localhost:/sdcard$ ls -l Download/HDoc/
total 0
localhost:/sdcard$ lsattr Download/HDoc/
localhost:/sdcard$
localhost:/sdcard$ sudo su -
root@localhost:~#
root@localhost:~# whoami
root
root@localhost:~#
root@localhost:~# ls /sdcard/Download/HDoc/
root@localhost:~#
root@localhost:~# chmod 600 /sdcard/Download/HDoc/*
chmod: cannot access '/sdcard/Download/HDoc/*': No such file or directory
root@localhost:~#
What could be the reason of not able to read the files inside some directories? Is it 000
permission on those files? And how come file manager is able to access?
I already tried another terminal too, same issue.