Results 1 to 8 of 8
I came across this command on the red hat site
Code:
chmod 2775 /usr/share/emacs/site-lisp
the link is here 32.5.1.*Group Directories
I find it confusing , how come there are 4 ...
- 06-21-2009 #1
chmod 2755 work/
I came across this command on the red hat site
the link is here 32.5.1.*Group DirectoriesCode:chmod 2775 /usr/share/emacs/site-lisp
I find it confusing , how come there are 4 number specifying the permission and also doing as instructed the permission of the directory has a 's' in the groups place . What does this mean???
Only if I could understand the man pages
Registered Linux user #492640
OS: RHEL4,5 ,RH 9,Ubuntu
- 06-21-2009 #2
The "s" would stand for "sticky" I believe. For directories where anybody can add files, yet nobody can delete them.
Edit: my mistake, above. You have set the Set Group bit.
From what I know, that means that the file/folder will borrow the owner user's group ID.
Same for Set User bit which borrows owner user's user ID.
Here's the manpage, please do correct me if I said anything wrong.
man chmod:
Code: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.
- 06-22-2009 #3
there are supposed to be only three digits for assigning permission If I m not wrong . So wat is that extra '2' doing there?
Only if I could understand the man pages
Registered Linux user #492640
OS: RHEL4,5 ,RH 9,Ubuntu
- 06-22-2009 #4
as previously stated, the 2 adds the group's sticky bit. any file created in that directory after that bit is set will automaticaly inherit the group owner.
most commands in linux have several syntaxes to be able to do different things. by putting 4 numbers instead of 3, you modify the sticky bit settings.New to the internet, technical forums, or the hacker / open source community??
Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html
RHCE for RHEL version 5
RHCT for RHEL version 4
- 06-22-2009 #5
Actually there are supposed to be 4 digits. But since few really need to mess with the SGUID, SUID and Sticky bits, only the basic 3 are used for permissions. The missing digits are considered zero.
So if I were to use
, it would be the same as usingCode:chmod 7 file.txt
Code:chmod 0007 file.txt
- 06-22-2009 #6
- 06-22-2009 #7
You're invited to try it out and see for yourself.
Code:chmod 7 file.txt ls -l file.txt
- 06-22-2009 #8
ya you are right !!
Only if I could understand the man pages
Registered Linux user #492640
OS: RHEL4,5 ,RH 9,Ubuntu


Reply With Quote
