chmod (change access permission)


chmod (change access permission)
- Used to change access permission(or file mode) to an existing file or directory.
(Only file owners or super users are allowed to change the mode.)
- mode option is specified as a character symbol or octal number.

Options and Symbols
  • the user to be changed(user target), the command to be performed (operating), and the permission to be set (access)
  • Multiple option are separated using commas (,)

  • options
    • -R
      Change the permissions of subdirectories and files (recursive)
    • the user to be changed
      • u
        abbreviation for "user", meaning file or directory owner
        g
        group owner
        o
        abbreviation for "others", meaning other users
        a
        abbreviation for "all", a combination of u,g,o (estimated to be all if no characters are used)
    •  the command to be performed
      • +
        add
        -
        remove
        =
        specify (Existing properties disappear.)
    • the permission to be set
      • r
        read
        w
        write
        x
        execute

Examples of frequently used options
+x
Add execution permission to all users (owners, groups, and others)
u+x
Add execution Permission to Owner
u-x
Remove the owner's execution permission
o-rw
Remove other users' "read and write" permissions
go=rw
assign "read, write" permissions to  groups and other users(remove if they previously had execute permissions)
u+x,go=rw
Add execution rights to owner and assign "read and write" permissions to groups and other users
a=rw
Assign "read, write" permissions to all users
g-w
Remove "write" permissions for group owners
g+w,o-x
Add "write" permissions to group owners, remove "write" permissions from other users


#chmod #permission #permission deny #linux #linux permission

No comments:

Post a Comment

Apartment Buying Guide 2025: Shocking Red Flags You Should NEVER Ignore!

 🏙️ Apartment Buying Guide 2025: Shocking Red Flags You Should NEVER Ignore! 🚨 Are you thinking about buying an apartment in 2025? 🏢  It’...