Linux file attributes

Source: Internet
Author: User
Linux file attributes. files starting with ls are regarded as hidden files and cannot be seen only by using ls commands. in addition to displaying common file names, ls-a can also display hidden files. Www.2cto. comls-l (this parameter is a small letter of L...
Linux file attributes. files starting with ls are regarded as hidden files and cannot be seen only by using ls commands. in addition to displaying common file names, ls-a can also display hidden files. Www.2cto.com ls-l (this parameter is the lowercase letter of the letter L, not the number 1). This command can display the file content in a long format. if you need to view more detailed file information, the ls-l command is required. For example, if I type ls-l in a directory, the following information may be displayed (a total of 7 columns): location ??? 1 ??????? 2 ????????? 3 ?????????? 4 ??? ??? ??? 5 ??? ??? ??? 6 ??? ??? ??? ??? 7 File Attribute File number the size of the group file to which the owner belongs file creation date file name drwx ------ 2 Guest users 1024 Nov 21 Mail-rwx -- x 1 root 89080 Nov 7 tar *- rwxr-xr-x 1 root bin 5013 Aug 15 uname * lrwxrwxrwx 1 root 4 Nov 24 zcat-> gzip-rwxr-xr-x 1 root bin 308364 Nov 29 zsh *-rwsr-x --- 1 root bin 9853 Aug 15 su * first column, indicates the attributes of a file. Linux files are basically divided into three attributes: readable (r), writable (w), and executable (x ). However, there are ten grids that can be added here (10 bits are actually implemented in a specific program ). The first cell is a special cell, indicating a directory or a link file, etc. d indicates a directory, for example, drwx ------; l indicates a link file, for example, lrwxrwxrwx; if it is a horizontal, indicates that this is a file. The remaining grids are in the unit of 3. Because Linux is a multi-user multi-task system, a file may be used by many people at the same time, so we must set the permissions for each file, the permission positions of the files are arranged in the following order (take-rwxr-xr-x as an example): rwx (Owner) r-x (Group) r-x (Other) in this example, the permissions are as follows: users are readable, writable, and executable; users in the same group are readable, writable, and executable; other users are readable, writable, and executable. In addition, the execution of some program properties is not x, but s, which indicates that the user who executes the program can temporarily execute the program with the same power as the owner. Generally, commands or programs such as system management enable the user to have the root identity during execution. The second column indicates the number of files. If it is a file, the number is naturally 1. if it is a directory, the number is the number of files in the directory. The third field indicates the owner of the file or directory. If the user is currently in his/her home, this column is probably the name of his/her account. The fourth column of www.2cto.com indicates the group to which it belongs ). Each user can have more than one group, but most users should belong to only one group. only when the system administrator wants to grant special permissions to a user, to another group. The fifth column indicates the file size. The file size is represented by byte, while the empty directory is usually 1024 bytes. of course, you can use other parameters to make the file display unit different, for example, if ls-k is used, the size unit of a file is displayed in kb. However, we generally use byte as the main unit. The sixth column indicates the creation date. In the format of "month, day, and time", for example, Aug 15 indicates on January 1, August 15. The seventh column indicates the file name. We can use ls-a to display hidden file names.

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.