Linux – File Permissions have Question Marks? How did this happen? How to scan for them

file-permissionslinuxpermissionsredhatuser-permissions

I have a bunch of files that are messing up my backup system (via rsync). The permissions are all question marks. How does this happen? How do I find them / scan for them? This partially breaks my backup system and I need to clean them up before the backup system runs.

d????????? ? ? ? ? ? sub
d????????? ? ? ? ? ? sample4
d????????? ? ? ? ? ? sample3
d????????? ? ? ? ? ? sample2
d????????? ? ? ? ? ? sample1
-????????? ? ? ? ? ? queue.sh
-????????? ? ? ? ? ? notes

Best Answer

This happens if the user you are using to access a directory does not have execute permission on the directory iteself. To list the contents of a directory read permission is enough. But to cd into the directory or show the permissions of files etc. inside the execute permission is needed:

user@server ~ $ ls test/ -la
total 0
d????????? ? ? ? ?            ? .
d????????? ? ? ? ?            ? ..
?????????? ? ? ? ?            ? testdir1
?????????? ? ? ? ?            ? testdir2
?????????? ? ? ? ?            ? testdir3
?????????? ? ? ? ?            ? testfile1
?????????? ? ? ? ?            ? testfile2
?????????? ? ? ? ?            ? testfile3
user@server ~ $ sudo chmod u+x test/
user@server ~ $ ls test/ -la
total 4
drwx------  5 user user   99 Mär 21 17:45 .
drwx------ 14 user user 4096 Mär 21 17:44 ..
drwx------  2 user user    6 Mär 21 17:45 testdir1
drwx------  2 user user    6 Mär 21 17:45 testdir2
drwx------  2 user user    6 Mär 21 17:45 testdir3
-rw-------  1 user user    0 Mär 21 17:45 testfile1
-rw-------  1 user user    0 Mär 21 17:45 testfile2
-rw-------  1 user user    0 Mär 21 17:45 testfile3

So you or your user which runs the backup probably does not have execute permission on some files etc.