File permissions and ownership under UBANTU

(Character and numeric representation of file permissions)
File owner-file belongs to group-other users
read-write-perform read-write-perform read-write-perform
r--- -w-----x r----w-----x r----w-----x
4—2-----1 4—2-----1 4-2-----1
777 means (4+2+1, 4+2+1, 4+2+1) readable, writable and executable

Modify file permissions command: chmod
command'chmod 777 text'
This command is used to modify the permissions of file'text'

SBIT sticky bit permission
Sticky bit (protection bit): The user protects the file belonging to the changed user can only be deleted by himself.
Instruction'chmod -R o+t linux/'
This instruction is used to modify the sticky bit permission of the file linux

Command to modify file hidden attributes: chattr
command'chattr +a text'
This command is used to add -a permission to file text
Command'chattr -a text'
this command is used to cancel -a permission to file

Show file hidden permission command: lsattr
command'lasttr text'
This command is used to show the hidden permission of file text

Guess you like

Origin blog.csdn.net/weixin_41407439/article/details/93126976