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!)

Advertisements

Published by:

Skyrail

Production Facilitator at Audacious Church Previously Software Developer at UKFast Ltd. and Web Applications Developer at SenseLogix Ltd. Graduate of Renewable Energy BSc from the University of Exeter. Experience with PHP, MySQL, Javascript, CSS and HTML.

Categories An Introduction to, LinuxTags Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s