Changing File Permissions

Let’s take a closer look at the contents of a sample directory by typing the command ls -l (the “l” stands for “long”.)

total 42
-rwxr-xr-x
-rw-rw-r--
-rw-rw-r--
-rw-r--r--
drwxrwxr-x
-rw-r-----
-rwxr-xr-x
  1
  1
  1
  1
  2
  1
  1
  joe  acctg
  joe  acctg
  joe  acctg
  joe  acctg
  joe  acctg
  joe  acctg
  joe  acctg
 23068
 12878
  2645
   168
  1024
   512
  2645
 Feb 26  2004
 Jul 24 21:58
 Jun 30 08:48
 Jul 17 11:51
 Mar 18 16:27
 Sep  1 07:00 
 Aug  4 11:03
 archive.sh
 orgchart.gif
 personnel.txt
 publicity.html
 sales
 topsecret.inf
 wordmatic
info info info info info info

The total line tells how many blocks (usually 1024 bytes per block) are contained in this directory.

To see what the columns in the remainder of the listing mean, click the “info” buttons beneath them.

Close window

The first character in this column tells what kind of file this is. The dash represents a normal file; the d represents a directory.

The remaining characters describe the file’s permissions, which we will cover in detail in the next pages.

Close window

This column tells how many hard links there are for this file.

Close window

These two columns tell you the name of the owner of the file and the group to which the owner belongs.

Close window

The size of the file, in bytes. For directories, this is the size of the directory, not the total of the directory’s contents!

Close window

This column contains the date and time at which the file was last modified. Note that you get time of day if the modification was during this year; otherwise you see the year.

Close window

The last column contains the file name.

  Index Your Permissions >>