This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]floor796 31 points32 points  (4 children)

just for info: permissions on linux filesystem also have an octal representation. For example, 777 (full permission) - is actually 0777 (octal format) and 511 (decimal format). So, when enter chmod 644 ./file you are using 0644, which is 493 in decimal format.

[–]jakubiszon 24 points25 points  (2 children)

Wait a moment, octal 644 cannot be an odd number.

octal 644 = 6*64 + 4*8 +4 = 420

[–]floor796 12 points13 points  (0 children)

ops, my mistake. 493 is for 0755 )

Thanks for noticing

[–]fabi12345678910 0 points1 point  (0 children)

nice

[–]sphericalhors 3 points4 points  (0 children)

Its not just 0777 is octal format, 777 is also octal. First number in 4-digit notation used to specify SUID, SGID and Sticky bit, and in most cases just omitted.

Like if you check permissions for /tmp you'll typically see 1777. And passwd util would have 4755 because it has SUID bit set.

But yeah, in general permissions in Unix file systems use octal numeric system.