130

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?
Yaron
  • 754

5 Answers5

124

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

mmoya
  • 230
C. K. Young
  • 2,296
46

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.
Alan
  • 583
15

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

11

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

Jon
  • 211
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.

SiegeX
  • 2,467