If I go into my unrooted phone's adb shell (Samsung galaxy s7 Android 8) I get a result similar to this:

dr-xr-xr-x 921 root   root         0 2020-01-26 10:06 acct
-rw-r--r--   1 root   root       225 1970-01-01 09:00 android.hardware.drm@1.0-service.widevine.rc
-rw-r--r--   1 root   root     45121 1970-01-01 09:00 audit_filter_table  

Notice that there is no . after the file permissions (eg: dr-xr-xr-x). If I type getenforce I get


so SELinux is enforced. Then why doesn't ls show a . after the file permissions? Has it always been this way in android? As far as I know, in Centos ls result will show a . after file permissions if SELinux is installed and enforced/permissive. Does android behave differently in this regard?

  • It depends which ls binary you are using. Android's default toybox ls is minimal. So is busybox ls. I use full coreutils ls which does show dot .. – Irfan Latif Jul 1 at 9:44
  • @IrfanLatif is this something extra I need to install? Or something that needs root? – user17915 Jul 1 at 9:46
  • coreutils like util-linux is kinda standard package every Linux distro has installed. You can build for your device. I have built for aarch64. If you need I can share link. – Irfan Latif Jul 1 at 9:50
  • @IrfanLatif so I need to compile it myself? It's not like an apk file we can install? – user17915 Jul 1 at 9:54
  • Termux is there already. But Linux packages there are modified for Android environment. So may not behave as you expect on a Linux distro. – Irfan Latif Jul 1 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.