I don't understand how permissions on directories work. For example:
r
: I can list all present files in a directory (e.g. ls
)
w
: I can modify a file in a directory, delete it and create a new sub-directory
x
: I can access to a directory (e.g. cd
)
If I'm right in the following situation:
-w-
- Can I remove a file if I already know its name?
- Can I remove a file even if I don't have write permissions to it?
Another question. In case of sticky bit (e.g. /tmp
) I can't remove or rename a file if I'm not its owner: in order to do it a file permission isn't enough?
r
and you can read the content of the "file" which is the file of files in directory,w
and you can modify the list of files in the directory, that is deleting or creating new ones,x
and here the metaphor breaks a little... so no good analogy. – Patrick Mevzek Aug 19 '18 at 16:10