[EdCert previous] [EdCert next] [EdCert top]

Note:to facilitate faster loading of EdCert documents, this page was borrowed from another source.


Determining Permission: ls -l

To determine the permission associated with a given file or directory, use the ls -l command to display the contents of the directory:

ls -l

total 501
-rw-r----- 1 user group 108 Oct 15 19:10 file.1
-rwxr-x--- 1 user group 6452 Oct 15 17:15 program.1
drwxr-xrw- 1 user group 512 Oct 15 19:19 letters

The first character indicates the type of the file

-   ordinary files
d   directory
l   symbolic link

The remaining nine characters represent three sets of three characters: one set for the individual user, one for the user's working group, and one for all other users. Spread out the characters of the display above to explain the groupings:

Type   User   Group   Others
 
 -     rwx     r-x     ---     program.1
 d     rwx     r-x     rw-     letters

The permissions given are for reading, writing, and executing. They have different meanings for ordinary files and directories. For an ordinary file, permissions are defined as follows:

read      permission means you may look at the contents of the file
write     permission means you mey change the contents of the file
execute   permission means you may execute the file as if it were a
          Unix command

For a directory, permissions are defined as follows:

read      permission means you may see the names of the files in the directory
write     permission mean you may add files to and remove file from the 
          directory
execute   permission means you change to the directory, search the directory,
          and copy files from it

The characters used to represent these permissions are:

r   read permission
w   write permission
x   execute permission
-   permission denied



[EdCert previous] [EdCert next] [EdCert top]