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
-
-RChange the permissions of subdirectories and files (recursive)
- the user to be changed
-
uabbreviation for "user", meaning file or directory ownerggroup owneroabbreviation for "others", meaning other usersaabbreviation 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
-
rreadwwritexexecute
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