1

What does this long listing mean?

$> ls -l developer.haml

-rw-rwSr-- 1 humon apache ......

I know what a usual listing means and I know all about what it means to be read 'r', write 'w', and executable 'x'. But what is 'S'?

1
  • Apart from the answers below, see man 2 chmod which reveals also the sticky bit.
    – ott--
    Commented Jul 3, 2013 at 19:44

2 Answers 2

6

From my man 1 ls:

Each field has three character positions:

...

  3.   The first of the following that applies:

       S     If in the owner permissions, the file is not exe-
             cutable and set-user-ID mode is set.  If in the
             group permissions, the file is not executable and
             set-group-ID mode is set.

       s     If in the owner permissions, the file is exe-
             cutable and set-user-ID mode is set.  If in the
             group permissions, the file is executable and set-
             group-ID mode is set.

       x     The file is executable or the directory is search-
             able.

       -     The file is neither readable, writable, exe-
             cutable, nor set-user-ID nor set-group-ID mode,
             nor sticky.  (See below.)

Basically,

S == setuid/setgid && not executable
s == setuid/setgid && executable
x == not setuid/setgid && executable
- == not setuid/setgid && not executable
4

S means setuid bit enabled, while s means setuid bit and executable bit both enabled.

2

Not the answer you're looking for? Browse other questions tagged .