Friday, November 9, 2018

terminal - How to find out the UID of a given file/folder?


I have an issue with inconsistent UIDs.


I would like to know how to manually find out the ID of a folder (specifically the /data partition). I think that it should be the same concept of an usual unix/linux filesystem but... I'm evidently getting older for this stuff :-)


From the Astro app I can see the details of the /data partition but it only tells me d-- and I cannot find any user id.



Actually, I have not set up any account on this phone, so there should be (I guess) only one UID present (the default one) apart from the system daemons etc.


Maybe for this reason it doesn't show up? Is there another, more powerful/informative app to be used? A file manager of some sort, a terminal console would be ideal for me.



Answer



I'd personally recommend using a terminal emulator or adb shell and then using the ls command. You can get the UID's listed by name if you use the -l flag and listed by number with the -n flag. Note that in the /data directory you'll need root permission in order to index the files/directories, so ls will fail with a normal user:


root@android:/data # ls -l
drwxrwxr-x system system 2012-08-27 14:29 anr
drwxrwx--x system system 2012-08-29 17:46 app
drwx------ root root 2012-08-27 00:54 app-asec
drwxrwx--x system system 2012-08-27 00:54 app-private
drwx------ system system 2012-08-27 00:55 backup

drwxrwx--x system system 2012-08-29 17:46 dalvik-cache
drwxrwx--x system system 2012-08-29 17:34 data
drwxr-x--- root log 2012-08-27 00:54 dontpanic
drwxrwx--- drm drm 2012-08-27 00:55 drm
drwxrwx--- gps system 2012-08-27 10:29 gps
drwxr-x--x system system 2012-08-27 00:54 lightsensor
drwxr-x--x root root 2012-08-27 00:54 local
drwxrwx--- root root 1969-12-31 19:00 lost+found
drwxrwx--- media_rw media_rw 2012-08-27 14:10 media
drwxrwx--t system misc 2012-08-27 00:54 misc

drwx------ root root 2012-08-27 10:30 property
drwxrwx--x system system 2012-08-27 00:54 resource-cache
drwxr-x--x system system 2012-08-27 00:54 sensors
drwxr-x--- root shell 2012-08-27 00:54 ssh
drwxrwxr-x system system 2012-08-30 11:05 system
drwxr-xr-x root root 2012-08-27 00:55 tf
drwx--x--x system system 2012-08-27 00:54 user

root@android:/data # ls -n
drwxrwxr-x 1000 1000 2012-08-27 14:29 anr

drwxrwx--x 1000 1000 2012-08-29 17:46 app
drwx------ 0 0 2012-08-27 00:54 app-asec
drwxrwx--x 1000 1000 2012-08-27 00:54 app-private
drwx------ 1000 1000 2012-08-27 00:55 backup
drwxrwx--x 1000 1000 2012-08-29 17:46 dalvik-cache
drwxrwx--x 1000 1000 2012-08-29 17:34 data
drwxr-x--- 0 1007 2012-08-27 00:54 dontpanic
drwxrwx--- 1019 1019 2012-08-27 00:55 drm
drwxrwx--- 1021 1000 2012-08-27 10:29 gps
drwxr-x--x 1000 1000 2012-08-27 00:54 lightsensor

drwxr-x--x 0 0 2012-08-27 00:54 local
drwxrwx--- 0 0 1969-12-31 19:00 lost+found
drwxrwx--- 1023 1023 2012-08-27 14:10 media
drwxrwx--t 1000 9998 2012-08-27 00:54 misc
drwx------ 0 0 2012-08-27 10:30 property
drwxrwx--x 1000 1000 2012-08-27 00:54 resource-cache
drwxr-x--x 1000 1000 2012-08-27 00:54 sensors
drwxr-x--- 0 2000 2012-08-27 00:54 ssh
drwxrwxr-x 1000 1000 2012-08-30 11:05 system
drwxr-xr-x 0 0 2012-08-27 00:55 tf

drwx--x--x 1000 1000 2012-08-27 00:54 user
root@android:/data #

No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...