Permissions treatment under Linux

Change permissions command
Chmod [who] [+ | - | =] filename
    Who: u-> owner g-> belongs to the group o-> others a-> everyone
    + Add permission - permission to cancel the assignment of certain rights =

 

 "D (catalog file) rwx (an owner has read and write permission executable) rwx (belonging group have read and write permission executable) RX (owned by other users as shown, i.e., the test folder permissions readable executable permissions, and write). "

 

Create a new file

 

 Check the permissions

 

 - (regular file) rw (belongs to those who have permission to read and write) rw- (owned group has permission to read and write) r - (others who have read permissions only)

Change permissions:

r——4,w——2,x——1

Add an owner executable permissions
chmod +100 t1.txt

 

 Remove an owner can write executable permissions, belongs to the group writable

chmod -320 t1.txt

 

 Change the file belongs to those who have read and write permissions, belongs to the group and others have only read permission
Chmod 644 t1.txt


Note: The recommended way to change the permissions of digital


change an owner or owning group
Chown root / test will be owner of the test change the root folder

 

 
Chgrp admin / test will change the admin test ask price belongs to group folders

 


Chown root: root test will be owner of the test folder belongs to root group to root

 

 
Chown -R root: lindsey test will test the next owner of all files to root belongs to the group changed lindsey

 

Guess you like

Origin www.cnblogs.com/lindsey101/p/11575490.html