Properties and permissions for Linux files and directories

Source: Internet
Author: User

Properties and permissions for Linux files and directories

This paper introduces the properties and permissions of files and directories of Linux system, such as index node inode, file type, file permission and owner, and also introduces the setuid, Getgid and paste bits. Among them, the use of LN, chmod, Chown, Chgrp, umask and other commands are described in detail and examples.


Files in Linux

Overview of file properties

The properties of a file or directory in a Linux system include: Index node (inode), type, permission attribute, number of links, user and user group, last modified time, etc.

Look at the results of the Execute LS-LHI command

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/75/57/wKioL1Y3InHTpYB1AAFdSSb0jwQ281.jpg "title=" 01.jpg "alt=" wkiol1y3inhtpyb1aafdssb0jwq281.jpg "/> detailed explanation diagram:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/75/59/wKiom1Y3Ip_ziI9rAAHKHGTE5qQ152.jpg "title=" 02.jpg "alt=" Wkiom1y3ip_zii9raahkhgte5qq152.jpg "/>

Text Explanation:

First column: Inode index node;

Second column: file type permissions;

Column three: number of hard links

Fourth column: the user (owner) of the file or directory to which it belongs;

Column Fifth: The group to which the user belonging to the file or directory belongs;

Sixth column: The size of the file or directory;

第七、八、九 column: The modified time of the file or directory, (use stat file name to see the modified time of the file)

The Tenth column: the actual file name or directory name;


Index node Inode overview

The inode Chinese means an index node. Partition of each storage device or storage device (storage device can be hard disk, floppy disk, USB drive ...) After being formatted as a filesystem, there should be two parts: an inode, and a block in the other part. Block is used to store data. The inode is used to store this data information, including file size, owner, attribution user group, read and write permissions, and so on.

The Inode indexes the information for each file, so there is a value for the inode. According to the instructions, the operating system can find the corresponding file by the Inode value.

For example, a book, a storage device or a partition is equivalent to this book, block equivalent to each page of the book, the Inode is equivalent to the book in front of the directory, a book has a lot of content, if you want to find a part of the content, we can first find the directory, through the directory can quickly find what we want to see.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/75/57/wKioL1Y3KGiDVz5lAAH1zarU7s4403.jpg "title=" 03.jpg "alt=" Wkiol1y3kgidvz5laah1zaru7s4403.jpg "/>

When we use LS to view a directory or file, if you add the-i parameter, you can see the Inode node.


Files with the same inode value are hard-linked files

In a Linux file system, files with the same inode value are hard-linked files. This means that, for different file names, the Inode value may be the same, and an inode value can correspond to multiple files. In Linux, linked files are created through the LN command.


This article is from the "Gin Network" blog, please be sure to keep this source http://pcn01.blog.51cto.com/8092345/1708903

Properties and permissions for Linux files and directories

Related Article

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.