Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the 'x' mean in rwx on a directory? [closed]

I got a testdir by mkdir testdir, and created a file in it by touch testdir/a.

drwxr-xr-x  2 jermaine     jermaine       4096 Mar 12 22:57 testdir

If I remove the 'x' by chmod -x testdir

Then I won't be able to

cd testdir

touch testdir/b

ls -l testdir

cat testdir/a

So my question is why can't I list the file hierarchy under a directory with a 'r' but without an 'x'? What exactly does the 'x' mean on directory?

I knew some explanations like "x means entering the direcotry, you have to enter before read and write". But what does 'enter' mean? I really appreciate answers on inode or dentry level. Thanks a lot.

like image 417
StarPinkER Avatar asked Mar 12 '13 07:03

StarPinkER


1 Answers

"Execute" is the traversal permission on a directory. It allows you to access files and folders within the directory.

If you can read a directory, you can list the contents.

If you can write a directory, you can make new files and folders within it.

If you can "execute" a directory, you can move through the hierarchy, even if you don't know what's inside.

like image 123
nneonneo Avatar answered Oct 07 '22 01:10

nneonneo