224 CHAPTER 14 (Apache web server) UNDERSTANDING LINUX FILES AND

224 CHAPTER 14 UNDERSTANDING LINUX FILES AND USERS The file permissions part of the listing might look confusing, but it s actually quite simple. To understand what s going on, you need to split it into groups of four, as illustrated in Figure 14-3. Figure 14-3. The file permissions part of a file listing can be broken down into four separate parts. The four groups are as follows: Type of file: This character represents the file type. A standard data file is indicated with a dash (-). Most files on your system fall into this category. A d shows that the entry is not a file, but a directory. Table 14-2 lists the file type codes. User permissions: Next come the permissions of the person who owns the file. The three characters indicate what the person who owns the file can do with it. The owner of a file is usually the user who created it, although it s also possible to change the owner later on. In this example, you see rw-. This means that the owner of the file can read (r) and write (w) the file. In other words, he can look at it and also save changes to it. However, there s a dash afterwards, and this indicates that the user cannot execute the file. If this were possible, there would be an x in this spot instead. Group permissions: After the owner s permissions are the permissions given to members of that user s group. This is indicated by another three characters in the same style as those for user permissions. In the example, the group s permission is r–, which means that the group members can read the file but don t have permission to write to it, since there s a dash where the w would normally appear. In other words, as far as they re concerned, the file is read-only. Everyone else s permissions: The last set of permissions indicates the permissions of everyone else on the system (other users in other groups). In the example, they can only read the file (r); the two dashes afterwards indicate that they cannot write to the file nor execute it. Table 14-2. File Type Codes Code File Type -Standard file d Standard directory l Symbolic link (a shortcut to another file)

Leave a Reply