Linux File Attributes learning notes

Source: Internet
Author: User

To understand the file attributes of Linux, an important and common command is "ls", a command for viewing files.

After you log on to Linux as a root user or a common user, Run "ls-al" to check the content in the current directory.


Total 192 refers ~ The capacity occupied by the Directory (unit: Kbytes). Because the contents in the directory are not continuously discharged, total> = total content capacity.

Ls indicates "list", which focuses on displaying the file name and related attributes. The parameter "-al" (different from "-a") indicates to list the detailed permissions and attributes of all files (including hidden files, that is, the first character of the file name is ". file ).

 

First, explain the meanings of the above seven columns:

Example:


 

The first column indicates the file type and permission (permission ):

Example:


The first character indicates that the file is "directory, file, or link file":

If it is [d], it is a directory. For example, the line in the above file is ". gconf;

If it is [-], it is a file. For example, the line above is "install. log;

If it is [l], it is a link file );

If it is [B], it is the interface device (random access device) that can be stored in the device file );

If it is [c], it indicates the serial port device in the device file, such as the keyboard and mouse (one-time reading device ).

 

The following characters are in a group of three. [R] in each group indicates read, [w] indicates write, and [x] indicates execute ). Note that the positions of these three permissions will not change. If you do not have the permissions, the minus sign [-] will appear.

The first group is "file owner Permissions ".

The second group is "permissions of the same user group ".

The third group is "Other permissions not for this user group ".

 

The second column indicates how many file names are linked to this node (I-node ):

Each file records its permissions and attributes to the I-node of the file system. However, the directory tree we use is recorded by the file name, therefore, each file name is linked to an I-node! This attribute records how many different file names are linked to the same I-node.

 

The third column indicates the "Owner account" of the file (or directory).

 

Column 4 indicates the user group to which the file belongs.

In Linux, your account is attached to one or more groups.

 

The fifth column lists the size of this file. The default unit is bytes.

 

Column 6 is the file creation date or the latest modification date.

The content of this column is the date (month/day) and time. If the modification time of this file is too long, only the year will be displayed in the time section.

If you want to display the complete time format, you can use the ls option: "ls-l -- full-time" to display the complete time format! Including year, month, day, and time.

 

Column 7 indicates the file name.

It is special that if there is one more "." Before the file name, it indicates that this file is "hidden file ".

Related reading:

Linux file attributes and Default Permissions

Linux File Attributes

Obtain file attributes in Linux

File Attributes in Linux

File Attributes in Linux

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.