Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I write: chmod g=rws,u=rwx,o=rx folder_name

I get: drwxrwSr-x

But S is not the same as s, right?

share|improve this question
up vote 6 down vote accepted

You specified the s bit for the group without the x bit. Executable and setgid are separate bits, the ls command just combines them into a single letter to gain space. You need

chmod g=rwxs,u=rwx,o=rx folder_name

i.e. chmod 2775 folder_name. You did chmod 2765 folder_name.

S means setxid without executable, it's in uppercase because that's rarely useful and likely a sign of a mistake that needs to be fixed.

share|improve this answer

The ls display has a fixed-size display field for the mode (a.k.a. permission bits), so it will show s (or t, for the restricted deletion flag – the so-called "sticky bit") if the executable-bit is present (since it is normally expected to be present on the either directories or executable files on which these bits are meaningful), and (capital) S (or T) if it is absent. chmod has no such constraint, so it simply assigns a letter to each mode bit.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.