Unix File Permissions

Submitted by dnieweg on Sat, 08/01/2015 - 21:03

File Permission Schema

All UNIX files have permissions and information attached to them that allow or deny access to the resource, based on the users role. The schema diagram below shows how permissions are structured.

Unix Master Schema

Breakdown of each schema field

File Type

The first character location tells us the type of the file. The most common are normal files signified by a ‘-‘, directories identified by a ‘d’ and symbolic links identified by an ‘l’.

Owner/Group/Other

The Owner, Group, and Other fields are each made up of three characters which either allow or deny read (r), write (w), or execute (x) activities. If the permission is enabled a single r, w, or x character will be present. If the activity is not allowed, a dash (-) will be present instead.

Links or Directories

The links or directories field found right before the owners name tells us either the number of hard links pointing to a regular file, or in the case of a directory, tells us the number of subdirectories found within the directory itself.

Owner Name / Group Name

Owners name hold the UNIX username of the owner of the file. In Unix groups are also available and can hold ownership rights as well. A user may belong to one or more groups.

File Size

The size of the file.

Create / Modify Date

Date the file was created or last modified.

Filename

The name of the file.

Explanation of ls Long Format & chmod through examples

-rwxr-xr-- 1 instruct staff 270311 Aug 11 2009 install.sh

Unix File Permission Example 1

-rw-r--r-- 1 instruct staff 348039 Aug 12 2008 User_Guide.txt

Unix File Permission Example 2

-rw-r----- 1 instruct staff 635106 Aug 12 2009 Admin_Guide.txt

Unix File Permission Example 3

drwxr-xr-x 4 instruct staff 144 Aug 12 2009 Documents

Unix File Permission Example 4

-rwsr-sr-x 1 nobody nobody 169202 Aug 11 2009 httpd

Unix File Permission Example 5