What is S in file permission -rwSr–r–?

cn flag
  • The permission -rwSr–r– represented in octal expression is 4644.

  • The permission -rwxr-sr– represented in octal expression is 2754.

read is 4 , write is 2 and execute is 1 . What this S or s is and how many numbers it contain . How we are getting above "octal numbers"?

Ruchir Mandora avatar
cn flag
My concern is more on getting ocatal value .
cn flag

Capital S in the user field means that setuid bit is set, but execute permission isn't (which makes little sense). Lowercase s means that both setuid bit and execute permission are set.

As for numeric values, it is everything explained in man chmod. Here's the excerpt:

A numeric mode is from one to  four  octal  digits  (0-7),  derived  by
adding up the bits with values 4, 2, and 1.  Omitted digits are assumed
to be leading zeros.  The first digit selects the set user ID  (4)  and
set group ID (2) and restricted deletion or sticky (1) attributes.  The
second digit selects permissions for the user who owns the  file:  read
(4),  write  (2),  and  execute  (1); the third selects permissions for
other users in the file's group, with the same values; and  the  fourth
for other users not in the file's group, with the same values.

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.