File permissions and the owner is a group Detailed

First, the file permissions

1.  File Properties

 



2.  file permissions defined for three main target

owner: owner , u

group: is a group , g

other: Other , o

3.  Each file for each class defines three visitors have permission

r: Readable

w: Writable

the X-: eXcutable , execution

(1)  for file

r: file can be used to view the contents of its kind tool to get

w: can modify its contents 

x: can put this document to draw the kernel starts a process

(2)  for directory

r: You can use ls see a list of files in this directory

w: You can create files in this directory can also delete files in this directory 

x: use ls -l view file metadata (this directory must be compatible with R & lt ), may cd enter the directory

X: only to directory x authority, do not give files x permissions

4.  file permissions list

 

spacer.gif 

5.  Modify File Permissions command

(1) chmod [OPTION]... MODE[,MODE]... FILE...

MODE

Modify all the permissions for a class of users:

u = g = o = and = a = u =, g =

Example:

spacer.gif 

spacer.gif 

spacer.gif 

spacer.gif 

Modify a class of users by a certain position or privilege

u+ u- g+ g- o+ o- a+ a- + -

Example:

spacer.gif 

spacer.gif in

 

(2) chmod [OPTION]... --reference=RFILE FILE...

Reference RFILE file permissions, the FILE changes for the same RFILE

Example:

spacer.gif 

(3) chmod [OPTION]... OCTAL-MODE FILE...

Parameters and examples:

-R: recursively modify the permissions 

spacer.gif 

(4)  a digital reference file permissions list representation modify permissions

Example:

spacer.gif 

Second, file the owner and group

1. The  owner modify the file: chown

(1) chown [OPTION]... [OWNER][:[GROUP]] FILE...

usage:

OWNER

spacer.gif 

OWNER:GROUP

spacer.gif 

:GROUP

spacer.gif 

NOTE: The commands available in the colon . Alternatively

-R: Recursive

spacer.gif 

 

(2) chown [OPTION]... --reference=RFILE FILE...

spacer.gif 

is a modified set of files: chgrp

Previously by chown demonstrates a variation which is set at the same time change the owner's command, the following presentation is a group of individual change command

(1) chgrp [OPTION]... GROUP FILE...

spacer.gif 

(2) chgrp [OPTION]... --reference=RFILE FILE...

spacer.gif 

(. 3)  -R & lt recursively

spacer.gif 

 


Guess you like

Origin blog.51cto.com/14483057/2435640