Permissions

The information line produced when you enter the command ls -l file1 is shown below:

For a directory, e-permission allows you to cd to the directory and open files within it.

The three sets of permissions for a given file or directory are held in three 3-bit sets:

000   0   No permission
001   1   Execute-only (useful for safeguarding software)
010   2   Write-only
011   3   Write and execute allowed
100   4   Read-only
101   5   Read and execute allowed
110   6   Read and write allowed
111   7	  Read, write and execute all allowed
On some systems they are displayed as the three corresponding octal digits:

Groups are sets of people with the same permissions. To see which group you are in, enter the command id. You can be a member of more than one group.

Changing Permissions

You can change the permissions for files you own. The most straight-forward way is to specify the three absolute permissions in octal as follows:

chmod 660 file1

There is what is supposedly a more user-friendly way of changing the permissions using letters:

Changing Ownership

You can transfer the ownership of one of your files to someone else as follows:

chown ruby file1

But you must be the owner of the file in the first place.

If someone copies a file that they own into your home directory, they still own it unless or until they transfer its ownership over to you.

If you copy one of their files (assuming the existing permissions allow) into your home directory, they still own the original, but you own the copy automatically.

Changing Group

You can also - as the owner of a file - change the group that can use it by entering:

chgrp workers file1


This page's parent within this Web Site. About this Web Site. Its home page. Email its Author.