Changing access permissions using the chmod command

1. To give yourself permission to execute a file that you own:

   chmod u+x file1

This gives you execute permission for the file "file1".

2. To give members of your group permission to read a file:

   chmod g+r file2

This gives the group permission to read the file "file2".

3. To give read permission to everyone for a particular type of file:

   chmod a+r *.pub

This gives everyone permission to read all files with the extension .pub.

4. To give the group write and execute permission:

   chmod g+wx $HOME/SCCS

This gives all members of the group permission to place files in the directory SCCS in your home directory. They can also list (ls) the contents of this directory.

Top document