Question marks in output of command "ls -la" in Ubuntu Question marks in output of command "ls -la" in Ubuntu nginx nginx

Question marks in output of command "ls -la" in Ubuntu


This issue is a permission problem. Specifically, it relates to execute bits on directories.

Consider the following example

$ mkdir -p remove_execute/remove_execute_test     $ touch remove_execute/remove_execute_test/test_file.txt $ ls -la remove_execute/remove_execute_test/ total 8 drwxrwxr-x 2 zerodf zerodf 4096 Nov 21 10:51 . drwxrwxr-x 3 zerodf zerodf 4096 Nov 21 10:51 ..-rw-rw-r-- 1 zerodf zerodf    0 Nov 21 10:51 test_file.txt

Now, if we remove execute permission on the directory, we can't get the stats.

$ sudo chmod a-x remove_execute/remove_execute_test/ $ ls -la remove_execute/remove_execute_test/ ls: cannot access remove_execute/remove_execute_test/..: Permission denied ls: cannot access remove_execute/remove_execute_test/test_file.txt: Permission denied ls: cannot access remove_execute/remove_execute_test/.: Permission         denied total 0 d????????? ? ? ? ?            ? . d????????? ? ? ? ?            ? ..-????????? ? ? ? ?            ? test_file.txt

Unless we have root permissions.

$ sudo ls -la remove_execute/remove_execute_test/total 8drw-rw-r-- 2 zerodf zerodf 4096 Nov 21 10:51 .drwxrwxr-x 3 zerodf zerodf 4096 Nov 21 10:51 ..-rw-rw-r-- 1 zerodf zerodf    0 Nov 21 10:51 test_file.txt