[Next] [Previous] [Up] [Top] [Contents]

3.7 File Maintenance Commands

3.7.4 File Permissions

Each file, directory, and executable has permissions set for who can read, write, and/or execute it. To find the permissions assigned to a file, the ls command with the -l option should be used. Also, using the -g option with "ls -l" will help when it is necessary to know the group for which the permissions are set (BSD only).

When using the "ls -lg" command on a file (ls -l on SysV), the output will appear as follows:

-rwxr-x--- user unixgroup size Month nn hh:mm filename

The area above designated by letters and dashes (-rwxr-x---) is the area showing the file type and permissions as defined in the previous Section. Therefore, a permission string, for example, of -rwxr-x--- allows the user (owner) of the file to read, write, and execute it; those in the unixgroup of the file can read and execute it; others cannot access it at all.

Introduction to Unix - 14 AUG 1996
[Next] [Previous] [Up] [Top] [Contents]