Gangmax Blog

自由之思想,独立之精神

Change File Permissions With Chmod

| Comments

From here.

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

1
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:
1
chmod o-w foo

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

1
chmod go-rw bar

To add execute permission to all:

1
chmod a+x foo

This is much more intuitional the “755” way.

Comments