Linux file attributes, linux attributes

Source: Internet
Author: User

Linux file attributes, linux attributes

In Linux, file attributes are an important concept. users or user groups can learn the permissions of a file from the file attributes.

We can use the ls-al command to list all files (including hidden files starting with.) in a folder ). The file attributes of install. log are as follows:

-Rw-r --. 1 root 71014 Jul 20 23:33 install. log

File Permission Connections File owner User Group to which the file belongs File Size Last modification time File Name
-Rw-r -- 1 Root Root 71014 Jul 20 23: 33 Install. log

The File Permission is represented by a string. The length of this specific string is 10. The 10 characters can be divided into four groups: 1 234 567 890

1: indicates the file type. Possible values include:

D: Directory

-: File (we can see that the install. log in the above example is a file)

|: Connection file

B: interfaces available for storage (in Linux, everything is a file, and the device is also a file)

C: serial port device

234: permission of the file owner. File permissions include readable, writable, and executable. They are represented by r, w, and x respectively. Note that the order of these three permissions is fixed, that is, rwx. If you do not have certain permissions on the file, the corresponding location is represented. For example, in the above example, 234 is rw-, which indicates that the file has read and write permissions but has no executable permissions.

567: permissions of the user group to which the file belongs.

890: others permissions.


Linux File Attributes

This file is set with guid and sticky bits
When the modified file is executed, it will have the permission to reorganize the owner.
Sticky bits are also called put delete bits. You cannot delete all
Use the chmod g-s and chmod o-t commands to remove the guid and sticky bits.
Then chmod 755 is a common file.

What does File Attribute f mean in linux?

D. This is the directory.
B. This is a special file.
C is a special character file.
L this is a symbolic link, or the-N flag is specified, or the symbolic link does not point to an existing file.
P is a special first-in-first-out (FIFO) file.
S: Local socket.
-This is a common file.
F. I don't know, but you made a mistake.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.