16

We have scripts looking at the output of ls -l output for permission information that have been failing recently on RHEL v6 systems which appear to be showing an extra . at the end of the permission entry that didn't used to be there before:

[root@rhel6vm ~]# ls -l
total 44
-rw-------. 1 root root  1399 Aug 17 15:01 anaconda-ks.cfg
-rw-r--r--. 1 root root 25485 Aug 17 15:01 install.log
-rw-r--r--. 1 root root  7253 Aug 17 14:59 install.log.syslog
[root@rhel6vm ~]#
          ^
          | up there

What does the full stop signify? And what else can appear in it's place?

Rob Oxspring
  • 285
  • 1
  • 4
  • 7
  • 1
    `We have scripts looking at the output of ls`, that is generally a [bad idea](http://mywiki.wooledge.org/ParsingLs). Parsing ls is a bad idea. You would be better off looking at the output of stat or some other tool for this purpose. – Zoredache Apr 01 '14 at 23:42

2 Answers2

19

info ls shows:

  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.
garg
  • 635
  • 1
  • 7
  • 17
8

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.

Bart De Vos
  • 17,761
  • 6
  • 62
  • 81