Understanding File Modes (Permissions)

The following section uses the word file to mean both files and directories, and the word plain, or regular, file to refer to a file (not a directory).

In the previous section, you saw that ls could tell you permission information about files:

ls -ldg security.html
-rwxr-xr--   1 blackie  users 12383 Mar 15 10:27 security.html

The following file modes (permission information) are given in the first 10 characters of each output line from a long listing (see Figure 14.1):

  • 1 character: file type

  • 3 characters: permissions for the user who is the file owner

  • 3 characters: permissions if not owner but in same group

  • 3 characters: permissions if not owner nor in same group

Figure 14.1. File mode is one file type bit and ...

Get Practical UNIX now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.