OpenWindows Advanced User's Guide

3.6.1 Displaying Permissions and Status (su ls -l)

You have already used the ls command to list files. The ls command has many options. Use the -l option to display a long format list. Files and directories are listed in alphabetical order. Figure 3-2 illustrates this method for displaying files:

Figure 3-2 Displaying Permissions and Status


The very first character on the line indicates the file type. A dash (-) is an ordinary file; a d indicates a directory, and other characters can indicate other special file types.

The next nine characters indicate the permissions for the file or directory. The nine characters consist of three groups of three, showing the permissions for the owner, the owner's group, and the world, respectively. The permissions for emptyfile are rw-r--r--, indicating that the owner can read and write this file, everyone can read it, and no one can execute it. The permissions for the directory veggies2 are rwxr-xr-x, indicating that everyone has read and execute permissions, but only the owner can write to it.

In addition to file permissions, the display shows the following information:

where dirname is the name of an actual directory within your file system. When you give the name of a directory, the ls -l command prints information on all the files and directories (if any) within that directory.