Linux file attributes finishing

Linux system is a typical multi-user systems, different users have different status, with different privileges. To protect the security of the system, Linux system access the same file (including directory files) for different users to do different provisions. In Linux we can use ll or ls -l command to display user and group attributes of a file and the file belongs.

1) 10 characters from left to right, said:

If you do not have permission, there will be a minus sign [-] only. From left to right using these figures to 0-9:

(1) The first digit indicates the type 0

In Linux the first character represents the file is a directory, file, or link files, etc.

- represents a file

 d for directory

 c character stream, which means the file serial port device, such as a keyboard, a mouse (one reading unit)

 s socket

 p pipeline

 l linked document (link file);

 b device file, which file means for storage of an interface device (random access device)

(2) positions 1-3 determine the owner (owner of the file) have access to the file. --- User

Permissions (3) 4-6 to determine the position is a group (the same group of users owner) owns the file, --- Group

(4) 7-9 to determine the position of other user who owns the file permissions --- Other

file type

Owner permissions

It is a set of permissions

Other user rights

0

1    2   3

4   5   6

7   8   9

d

R   w   x

R   -   x

R   -   x

Directory files

Read write execution

Read write execution

Read write execution

2) the role of different interpretations rxw files and directories

(1) applied to the file:

Representative [r] read (read): read, see

[W] representative may write (write): it can be modified, but it does not mean you can delete the file, delete a file on the premise that you have write access to the directory where the files to delete the file.

[X] Representative executable (execute): the system can be performed

(2) applied to the directory:

Representative [r] read (read): read, ls view contents of

[W] representative may write (write): You can modify, create a directory within the directory renaming + Remove +

[X] Representative executable (execute): you can enter the directory

3) Case

[Liyinxia hadoop101 @ ~] $ ls -l

The total amount of 8

drwxrwxr-x. 2 liyinxia liyinxia 4096 5月  27 14:14 hello

-rw-rw-r--. 1 liyinxia liyinxia 34 5月  27 14:20 test.txt

 

 

Guess you like

Origin www.cnblogs.com/lyxcode/p/11620387.html