Access permissions

Access permissions are shown in the file mode, which can be displayed by the ls command. Permissions can be changed using the chmod command and default permissions set by using umask.

The file mode consists of a string of 10 characters:

  • User means the computer user who owns the file.
  • Group is usually a collection of users engaged in similar work.
  • To permit a directory to be executed means to allow it to be searched.
  • There are other types of files; those mentioned are the most common.

Examples

  • -rw-------  2 nabc         3287 Apr  8 12:10 file1
    The owner of the file has read and write permission.

  • -rw-r--r--  2 nabc         3287 Apr  8 12:11 file2
    The owner has read and write permission. Everyone else (the group and all other users) can read the file.

  • -rwx--x--x  2 nabc         3287 Apr  8 12:10 myprog

    The owner has read, write and execute permission. Everyone else can execute the file.

  • drwxr-x---  2 nabc         1024 Jun 17 10:00 SCCS
    The owner has read, write and execute permission to this directory. The group can read and search it. Nobody else can get access.