Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This question already has an answer here:

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'?

share|improve this question

migrated from stackoverflow.com Jul 3 '13 at 17:46

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

marked as duplicate by Mikel, Anthon, casey, jasonwryan, slm Mar 9 at 16:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

2 Answers 2

up vote 3 down vote accepted

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

share|improve this answer
    
A good article that covers all the flags: danielmiessler.com/study/unixlinux_permissions –  Andrejs Cainikovs Jul 3 '13 at 17:48
    
Thanks @Andrejs –  harmonickey Jul 3 '13 at 17:51
    
Except this appears in the group bits, so it's setgid. –  Mikel Mar 9 at 15:53

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
share|improve this answer

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