chmod equals (=) sign?

So while setting up postfix I came across the following command

chmod o= /etc/postfix/mysql-virtual_*.cf 

And I realised I’d not come across the equals (=) operator in the chmod command before. So here’s a quick run down of what it’s used for.

The command format is as follows:

chmod u=rwx,g=rwx,o=rwx [file]

Either of the equals groups is optional e.g. if you just want to set the permissions for the file’s ‘group’:

chmod g=rwx [file]

And you don’t have to provide all of the permssions e.g. if you only want to give the file’s ‘user’ (owner) read permissions:

chmod u=r [file]

To remove the permissions from an entity either leave it blank or add three dashes:

chmod u=--- [file]

or

chmod u= [file]

You can also enter partial permission:

chmod o=rx [file]

Saves having to remember the octal syntax each time (still, it’s good to learn that too!)

Leave a comment