Directory Permissions

Directories are also files under Linux. For example, again use the ls command to show permissions like this:

matthew@seymour:~$ mkdir directorymatthew@seymour:~$ ls -ld directorydrwxr-xr-x  2 matthew  matthew  4096 2010-06-30 13:23 directory

In this example, the mkdir command is used to create a directory. The ls command, and its -ld option, is used to show the permissions and other information about the directory (not its contents). Here you can see that the directory has permission values of 755 (read + write + execute or 4 + 2 + 1, read + execute or 4 + 1, and read + execute or 4 + 1).

This shows that the owner can read and write to the directory and, because of execute permission, also list the directory’s contents. ...

Get Ubuntu Unleashed 2013 Edition: Covering 12.10 and 13.04, Eighth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.