Home   |   Guides and Tutorials   |   What's New?   |   Comments   |   About
 

chmod: Changing File and Directory Permissions

by Tammy Fox
Last Modified: Wednesday, 19-May-2004 11:55:31 EDT

Introduction
    chmod is a standard Unix/Linux command that allows you to change the permissions of a file/directory. If you do not understand permissions, see the Reading File/Directory Permissions guide before continuing.

Using chmod
    There are two arguments for chmod: the permissions and the file/directory name. The permission argument for chmod is based on numbers.

    1 stands for execute.
    2 stands for write.
    4 stands for read.

    To set more than one permission on a file/directory, you just add up the permissions. For example, 7 means read, write, and execute permissions. Chmod takes the permissions as the first argument in the order user, group, global. Thus, the command chmod 777 hello will change the permissions of the file hello to read, write and execute by user, group, and everyone else.

    Note: To change the permissions of a file/directory, you must be the owner of that file/directory. However, root can change permissions on any file/directory.

What's Related


All Rights Reserved Linux Headquarters © 2000-2007
Linux is a registered trademark of Linus Torvalds
All logos are registered trademarks of their respective owners
Last modified: Wednesday, May 19, 2004