chmod example permission values

4 read
2 write
1 execute

User
Group
Others

These are the values for chmod. Add up the values. The first digit is for User, second Group, third others. eg. 722 gives owner all, and everyone else write (but no read) rights.

 

755:

644 - same as 755 w/o execute bit for anyone:

 

Apply permission change to all 3 groups:

Use "a" for "all" - e.g. chmod a-w conf.php to remove write permissions from user, group, and others.

 

Add specific permissions:

Give owner write permissions, recursively: chmod u+w * -R

To add group rwx permissions, you should use: chmod -R g+rwx DirectoryName

WARNING: Do not use "o", this is "other" (not owner!)
 

Get existing numeric ("octal") permissions:

stat -c '%a %n' *

 

tags: chmod, example, commands, permissions, file, directory

Related Scribbles:
  • Linux Commands


  • ID: 85
    Author:
    leonard
    Date Updated:
    2019-05-02 10:27:17
    Date Created:
    2002-09-21 02:02:39

    Edit

    Comments?
     >> Leonard Chan's Homepage  >> Scribble Web  >> chmod example permission values
    leonard.lotus-land.ca is hosted by Perceptus Solutions Inc.