linux - Why can the `ls` command of Ubuntu list the files of a directory with no execution permission set? -


why can ls command of ubuntu list files of directory no execution permission set ?

the test directory has read , write permissions set no execution permission set. understand x attribute of directory specify whether directory can accessed, , if not set doesn't matter whether r or w set (please correct me if i'm wrong).

the cd , cat commands works expected, i.e. cannot job, since cannot access directory.

enter image description here

having +r not +x on directory allows reading contents, not making current directory. conversely, having +x on directory not +r allow make current directory not list it.

in other words, on directory:

  • r: read bit allows read contents of directory
  • w: write bit allows create, rename , delete files
  • x: execute bit allows chdir directory

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

go - Idiomatic way to handle template errors in golang -