OSU Computational Physics - Landau Research Group (nacse) -
Next 5.M: Review Quiz  Up 5: Managing Files and Directories  Prev 5.L.1: Looking at File Permissions  Contents

Basic

§ 5.L.2:  Changing File Permissions


Now that you know what your file permissions are, it's time to modify them. The "change mode" command chmod changes the permissions of files as dictated by the command arguments. There are a number of ways to state the arguments for the "change mode" command.

One way is to give the command followed by the permission access you would like to change and the name of the file to be affected:

For example, let's say we want to change permission for the file area.f in directory development/prog. First we get to it and check what's there:

> cd ~/development/prog
> ls -l

-rw-r--r--   1 melanie users         68 Mar  3 13:18 area.f

We see from listing that melanie has read and write permissions, while the group and outside world have only read access. To change a file's permission access, you enter the chmod command with arguments giving the party affected, whether you want to add ore remove permission, and finally the set of users affected. For example, change the file permission of area.f to allow everybody to execute it, and for the group to write to it, and check the result:

> chmod a+x,g+w area.f
> ls -l