UNIX chmod command

To change permissions on a UNIX file or directory, use the chmod command.

chmod category+permissions filename

category can be omitted, in which case the permissions specified are granted to all three categories (user, group and other). If + is replaced by a -, then those permissions are taken away from the categories.

As an example, consider this statement:

chmod o+r data

This grants other read permission to the file data. The command

chmod +x data

grants everyone (user, group and other) execute permission, and the command

chmod g+rwx data

gives category group read, write and execute permission.

Permissions change cumulatively, in that the commands

chmod +r file
chmod +w file
chmod +x file

are equivalent to

chmod +rwx file