Gangmax Blog

Change File Permissions with chmod

From here.

To remove certain permissions from a file, use this command:

chmod who-value file...

where who specifies from which type of user these permissions are to be removed:

  • u to change the owner’s (“user’s”) permissions;

  • g to change group permissions;

  • o to change world (“other”) permissions; or

  • a to change all permissions: owner, group and world.

and value says which permissions to remove:

  • r for read permission;

  • w for write permission; and

  • x for execute permission.

For example:

  • To remove world write permission for file foo:
chmod o-w foo

To remove group and world read and write permissions from file bar:

chmod go-rw bar

To add execute permission to all:

chmod a+x foo

This is much more intuitional the “755” way.