9
2
I have a professor who insists on always typing chmod 7777
, but I was taught that chmod 777
was the proper convention.
I tried them out on the command line and chmod 777 something.txt
yeilds
-rwxrwxrwx 1 home staff 0 May 6 16:47 something.txt
and chmod 7777 something.txt
yields
-rwsrwsrwt 1 home staff 0 May 6 16:47 something.txt
Which changes the executable fields to s, s and t. I understand 777 because it's 111 111 111 in binary, so its just turning on all the fields, but why would I use 7777 and what does it do differently?
Related: How does the sticky bit work?
– Scott – 2017-10-29T06:44:20.620Is there any difference between mode value 0777 and 777 – phuclv – 2018-02-12T09:34:44.713
2
It has to do with the
– fedorqui – 2013-05-06T20:58:33.270sticky bit
. You can check http://en.wikipedia.org/wiki/Sticky_bitAlso see http://en.wikipedia.org/wiki/Setuid
– None – 2013-05-06T20:58:46.8274And as a warning, there are only very specific situations you need to use it. Why your professor would set it normally without explanation is asking for security issues. – None – 2013-05-06T21:00:06.507