Directory Ownerships and Permissions Flashcards
Because directories are also files, they have a…?
user owner, a group owner, and a set of permissions.
Read permissions allow a user to…?
list the contents of a directory.
Write permissions allow a user to…?
access a file within the directory.
Execute permissions allow a user to …?
access a file within the directory.
Directory permissions are…?
modified with chmod command.
When someone is using a file within Linux, they are generally either…?
reading its information, modifying its information, or trying to execute the file as a script or application. (Therefore the permission types are already discussed, namely (r)ead, (w)rite, and e(x)ecute have a very natural interpretations).
To Linux, a directory is just a special type of file, therefore it also has the same types of….?
permissions ((r)ead, (w)rite, and e(x)ecute), a user owner, a group owner, and the same classes of access ((u)ser, (g)roup, and (o)ther. However, directories are obviously used differently.
Would it be meaningful to open a directory in an editor, such as nano/home/elvis?
Because people use directories differently, directory permissions have different interpretations.
What do people do with directories…?
They list their contents with the ls command. They remove files from them, create new files within them, and move files from one directory to another.
Directory permissions should allow a directory owner to control…?
who can perform which of these operations.
Linux considers listing a directory’s contents (as with the ls command) analogous to..?
“read”ing a directory, and therefore someone must have (r)ead permissions to list its contents.
Adding or removing a file from a directory is considered…?
“write”ing to the directory, and therefore someone must have (w)rite permissions in order to shuffle files within the directory.
There is no reasonable analogy to “execute”ing a directory, so Linux doesn’t try to define a similar behavior. Instead, the e(x)cute permission controls…?
a behavior for directories which has nothing to do with the command execution. In order to access any file within a directory, a user must have e(x)cute permission. This permission is known as the “search” permission, but the third permission was already called “execute” for regular files. the same word (and letter) is used for directories as well. In order to refer to any file within a directory (including subdirectories!), a user must have e(x)ecute permissions.
What (r)ead, (w)rite and e(x)ecute permissions mean to a regular file..?
(r)ead = view the file
(w)rite = modify the file
e(x)ecute = use the file as a command
What (r)ead, (w)rite, e(x)ecute permissions mean to a directory…?
(r)ead = list directory contents
(w)rite = add or remove files
e(x)ecute = “search” for a known file within the directory.