Permission and file editing commands
The second line represent the security as ---------
--- --- ---
rwx rwx rwx
user group other
r- mean read
w- Mean write
x- mean execute
If we replace rwx by --- then all permission will be revoked.
u→ user, g→ group and o→ other
If want change permission of file with user/group and others level
Like chmod u/g/o or ugo+/-(+ for adding)(-for revoking permission) fileName
We will go though the following given steps
- First step of chmod then ‘u’,g’,’o’ you can also used the combined permission of file using ugo i.e. chmod ugo
- After above step we will use the + for add permission - for revoke permission and = assigning permission
- Then specify permission of r,w and x which you want to change.
- The user can use commons to modify more permission.
- Finally name of the file.
Example:
- chmod ugo+rwx testfile.txt
- chmod ug+rwx,o-rwx testfile.txt
- chmod go+rwx,u-rwx testfile.txt
- chmod 777 testfile.txt
- chmod -777 testfile.txt
- chmod =777 testfile.txt