95

Some of the files in my directories under Linux have a . at the end of the permissions listing.

  • What does the dot mean at the end of -rw-r--r--?
  • How do you set it with chmod?

migrated from stackoverflow.com Jan 8 '11 at 10:43

This question came from our site for professional and enthusiast programmers.

104

According to ls.c (line 3785), . means an SELinux ACL. (+ means a general ACL.)

33

I had the same question. It took me a while to find this, having browsed the "man ls" page a hundred times (well, maybe not that often) until I finally saw the note in the SEE ALSO section about using the command:

 info coreutils 'ls invocation'

In the section describing "-l" (--format=long):

 Following the file mode bits is a single character that specifies
 whether an alternate access method such as an access control list
 applies to the file.  When the character following the file mode
 bits is a space, there is no alternate access method.  When it is
 a printing character, then there is such a method.

 GNU `ls' uses a `.' character to indicate a file with an SELinux
 security context, but no other alternate access method.

 A file with any other combination of alternate access methods is
 marked with a `+' character.
10

It means the file has an access list with SELinux. Check out this topic, it tells you how to allow you to edit/change the file http://ubuntuforums.org/showthread.php?t=1315684

  • This does not work for me – Josef Klimuk Aug 7 '18 at 14:02
8

This is SELinux context. Try ls -Z /your/file

Quoting my man ls

   SELinux options:

   --lcontext
          Display security context.   Enable -l. Lines will probably be too wide for most displays.

   -Z, --context
          Display security context so it fits on most displays.  Displays only mode, user, group, security context and file name.

   --scontext
          Display only security context and file name.

To change this, try one of these commands: chcon or semanage fcontext or restorecon

Quite neatly explained here: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html

2

Most likely this is due to an Access Control List (ACL) although I've only seen them shown as a + as in rw-rw-rw-+. Perhaps the . means a lack of an ACL on that file.

You can try typing getfacl . in the current directory to see what access controls those files might have.

  • 2
    Nope, the dot doesn't mean lack of ACLs - see other answers – Linker3000 Jan 8 '11 at 10:55

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.