Modifying files using chmod

linux-penguinGetting to grips with the command line in Linux will mean that you'll always be able to manage practically any Linux distribution (and there are literally hundreds) without having to learn a new interface.

Command line instructions are often quicker to implement as well.


Here is an example of chmod use...

drwxrx-xr-x 2 steven root 4096 2007-06-11 20:11 mydirectory

rwx means that you have Read, Write and eXecute permissions, and - means that you don't. The rwx's are shown for OWNER, GROUP, and OTHER.

In this example we have a directory called mydirectory with rwx for the OWNER, r-x for GROUP, and r-x for OTHER

rwx's can be represented numerically using a binary format as follows:
r w x = 7, r w - = 6, r - x = 5, r - - = 4, - w x = 3, - w - = 2, - - x = 1, and - - - = 0

Our example drwxr-xr-x could therefore be represented as 755

 

Thanks for visiting.