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.

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

2 Answers 2

up vote 7 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, so it will show s (or t, for the restricted deletion flag - 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 S 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

 
discard

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

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