Home  >  Article  >  System Tutorial  >  Detailed explanation of Linux file attributes and permissions

Detailed explanation of Linux file attributes and permissions

WBOY
WBOYOriginal
2024-06-01 17:06:00393browse

In Linux, any file has three identities: "User, Group, Others"

One of the most useful functions of user groups is that when you develop resources in a team, each account can be supported by multiple user groups

Linux file properties:

1. After logging in to Linux as root, execute "ls -al" (ls:list, which displays the file name and related attributes of the file; -al: lists the detailed permissions and attributes of all files (including hidden files) ));

Detailed explanation of Linux file attributes and permissions

First column: file type and permissions
The first letter represents the file type: d directory
-document

lLink file

bThe interface devices available for storage in the device file

c represents the serial port device in the device file, such as a keyboard, mouse and other one-time reading devices·

The next three groups are grouped together. The first group is the permissions of the file owner (User), the second group is the permissions of the same user group (group), and the third group is the permissions of other non-user groups (Others)
2. Second column: How many file names are connected to this node (i-node)

Each file will record its permissions and attributes into the i-node of the file system. However, the directory tree we use is recorded using the file name, so each file name will be connected to an i-node. , this attribute records how many different file names are connected to the same i-node number
3. The third column: owner account

4. The fourth column: the user group to which the file belongs

5. The fifth column: capacity size, default unit B

6. The sixth column: Creation or last modification date

View the full time ls -l --full-time

(You can use "LANG = en_US" to modify the language for garbled characters)

(Modify the system configuration file "/etc/sysconfig/i 18n", use nano to modify the content of the file, and make "LANG = en_US" so that the system default language is English)

7. The seventh column: file name

Detailed explanation of Linux file attributes and permissions

rwx: The location will not change. If there is no permission, a minus sign (-) will appear

r:read

w: writable (write)

x:executable

The Importance of File Permissions

One of the differences between Linux and Windows: In the Linux system, each file has a lot of attributes added, especially the concept of user groups

1. System protection function (data security)

2. Team development software or data sharing function

3. Failure to set permissions properly will cause some harm

The above is the detailed content of Detailed explanation of Linux file attributes and permissions. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn