O'Reilly logo

Linux and Unix Shell Programming by David Tansley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1.5. Directories

Remember I said earlier that directories have a different meaning when you use the chmod command? Well, here’s why. The ‘read’ bit means to be able to list the contents of the files. The ‘write’ bit means you can create files in this directory, so if you don’t want users to leave files lying around your directory then take away this permission bit! The execute bit on permissions actually means to have the privilege to search or access that directory.

Table 1.5. Directory permissions
r w x
Yes, you can list the files in this directory Yes, you can create/ delete files Yes, you can search or cd into the directory
Table 1.6. Directory permission example
Permission/ chmod Owner Group Other
drwx rwx r-x (775) Read, write, execute ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required