Symbolic representation of access modes
Access modes are represented symbolically.
| Item | Description |
|---|---|
| r | Indicates read permission, which allows users to view the contents of a file. |
| w | Indicates write permission, which allows users to modify the contents of a file. |
| x | Indicates execute permission. For executable files (ordinary files that contain programs), execute permission means that the program can be run. For directories, execute permission means the contents of the directory can be searched. |
The access modes for files or directories are represented
by nine characters. The first three characters represent the current Owner permissions,
the second sent of three characters represents the current Group permissions,
and the third set of three characters represents the current settings for
the Other permissions. A hyphen (-) in the nine-character set
indicates that no permission is given. For example, a file with the access
modes set to rwxr-xr-x gives read and execute permission to all three
groups and write permission only to the owner of the file. This is the symbolic
representation of the default setting.
The ls command, when used with the -l (lower case L) flag, gives a detailed listing of the current directory. The first 10 characters in the ls -l listing show the file type and permissions for each of the three groups. The ls -l command also lists the owner and group associated with each file and directory.
The first character indicates the type of file. The remaining nine characters contain the file permission information for each of the three classes of users. The following symbols are used to represent the type of file:
| Item | Description |
|---|---|
| - | Regular files |
| d | Directory |
| b | Block special files |
| c | Character special files |
| p | Pipe special files |
| l | Symbolic links |
| s | Sockets |
For example, this is a sample ls -l listing:
-rwxrwxr-x 2 janet acct 512 Mar 01 13:33 januaryHere, the first hyphen (-) indicates a regular file.
The next nine characters (rwxrwxr-x represent the User, Group, and
Other access modes, as discussed above. janet is the file owner,
and acct is the name of Janet's group. 512 is the file size
in bytes, Mar 01 13:33 is the last date and time of modification,
and january is the file name. The 2 indicates how many links
exist to the file.