Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Octal chmod/umask codes' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Octal chmod/umask codes
Authored by: seika7 on Mar 22, '04 06:33:18PM

"How does this octal 022 relate to the chmod style of permissions '770' or 'ug=rwx o=' for instance?"

These numbers are masks, which subtract, digit by digit, from the maximum octal value of 777 (read/write/execute for user, group, and everyone). (Remember, the maximum digit value in octal is 7 (like 9 for decimal), then the next digit goes to 1 (like 10 in decimal). 8 in decimal is 10 in octal, but don't pronounce it "ten" unless you want to get confused in a hurry.) So a mask of 022 would knock 777 down to 755 which is rwx for the user (owner) and rw for group and everyone. What many file sharing users want is a mask of 002 which knocks 777 down to 775 giving both the user and the group read/write permissions and allowing everyone else to just read.



[ Reply to This | # ]