home:computing:linux:file_system:on_directory_permissions
on directory permissions
from https://askubuntu.com/questions/862289/difference-between-executable-directory-vs-executable-files
It’s useful to think of a directory just as a file which is a list of file names.
Read bit – If set, you can read this list. If you have a directory named books:
- You can ls books and you’ll get a list of the files it contains (-l won’t work however).
- You can use command-line completion i.e. touch books/bo+Tab to get books/bookfile.
- You cannot make books your working directory, cd won’t work.
Write bit – You can modify this list names on it. You can only do this if the execute bit is also set.
Execute bit – You need this permission if you want to:
- Have any access to files within the directory.
- Modify details of the list itself. You can add, rename or delete names on the list, but this also requires write permission on the directory.
Setting the execute bit on a directory does not in any way affect the files themselves, but it does affect your access to them. For instance if you have write and execute access for a directory, you can move, rename and delete files, even if you can’t write into the files themselves.
home/computing/linux/file_system/on_directory_permissions.txt · Last modified: 23:01 27/01/2025 by acz
