Permission for files:
chmod 664 myFile // rw-rw-r--
And for folders:
chmod 774 myFolder // rwxrwxr--
If I only use the "read and write" permission, the folders won't show its contents, why ?
migrated from stackoverflow.com Jul 28 '10 at 0:21This question came from our site for professional and enthusiast programmers. |
|||
|
|
|||
|
Directories (they're not typically called folders in *nix) have different meaning for the permission bits than normal files. For directories, write allows creating new files inside of it. Read allows you to list the files inside of it. Execute allows you to enter it and access files (or other directories) inside. |
|||||
|
|
Since you can't 'execute' a directory, the execute bit has been put to better use. The execute bit on a directory allows you to access items that are inside the directory, even if you cannot list the directories contents.
From the
|
||||
|
|
|
Execute permissions on a directory allow you to traverse it, for using resources contained within it. |
|||
|
|
|
The Here's an example of its use: If you want to have a user with limited read permissions on every directory but his home, say |
|||
|
|
|
The "execute" bit actually means "search" when applied to directories (from |
|||
|
|
|
When you ask the OS to open the folder, you are performing (i.e. executing) an operation on it. |
|||||
|