How to understand rwx permissions for directories? [closed]

拟墨画扇 提交于 2019-12-11 01:19:32

问题


What does it mean to read, write, and execute a directory? It's intuitive on files, but I don't understand it for directories.


回答1:


If you have write permission for a directory, you can create new entries (files/folders/etc).

If you have read permission for a directory, you may list ls the directories contents.

If you have execute permission for a directory, you may change chdir into that directory.

For more information, please see this thread: http://www.unix.com/unix-dummies-questions-answers/98744-about-read-write-execute-permissons-directory.html




回答2:


A read in a directory implies you can do a ls in it -- thus reading what's in that directory.

A write enables you to write a file in the directory. This one is fairly intuitive.

An execute is a little bit less intuitive. An execute allows you to cd into a directory.

You could do a read in a directory without actually being in it. A possible use for execute only permissions on a directory would be if you want someone to be able to cd in a directory but you don't want him to be able to see what files/folders are in that directory (implying that the user knows the file/folder name to access within that directory)



来源:https://stackoverflow.com/questions/17867628/how-to-understand-rwx-permissions-for-directories

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!