Web Hosting Talk







View Full Version : chmod a-w is what in absolute form?


seodevhead
09-13-2005, 04:36 PM
I only know the absolute form of chmodding... like...

chmod 777
chmod 644, etc

I need to chmod something with...

chmod a-w filename.php

What absolute number (ie. 644) does a-w equate too? Thanks!

wolseley
09-14-2005, 04:59 AM
The positions for the rights go {owner}{group}{all}. For execute permission, you add 1 to the position, for write you add 2 and for read you add 4.

So, to give the owner all permissions, the group read and write and everyone else read only, you have:

owner = 1+2+4 = 7
group = 2+4 = 6
all = 4

which gives 764

So, chmod a-w is the same as subtracting 2 from each position BUT only when the position already has write permission!

i.e chmod a-w on a 777 file would give 555, but chmod a-w on a 764 file would give 544.

andren
09-14-2005, 11:03 AM
Basically it takes out all 'w' from the permission settings.