Linux-file attributes and permissions

Source: Internet
Author: User


Ls-display FILE attributes: ([OPTION]... [FILE]...)

Permission description:

File Type: If it is [d], it is a directory; if it is [-], it is a file; if it is [l], it is represented as a link file ); if it is [B], it indicates the interface device (random access device) in the device file; if it is [c], it indicates the serial port device in the device file, for example, the keyboard and mouse (one-time reading device ). Permission group: The next character is a group of three parameters, which are a combination of the three parameters of "rwx. [R] indicates read, [w] indicates write, and [x] indicates execute ). The location of the three permissions www.2cto.com will not change. If you do not have the permission, the minus sign [-] will appear. At the same time, the weights of r, w, and x are 4, 2, and 1. The first group is "permission of the file owner", and the "install. for example, the owner of the file can read and write but cannot execute the file. The second group is "Same Group Permissions 』; the third group is "Other permissions not in this group" to change the file attributes and permissions. 1. chgrp: Change the group to which the file belongs (chgrp [OPTION]... group file ...) 2. chown: Change the file owner (chown [OPTION]... [OWNER] [: [GROUP] FILE ...) 3. chmod: change file permissions. Features of SUID, SGID, SBIT, etc. 3.1 chmod [-R] xyz files or directories (x, y, z are the sum of rwx) 3.2 change the File Permission of the symbol type chmod ugoa + (ADD)-(remove) = (SET) Importance of the rwx file or directory permission on the file: r (read ): can read the actual content of this file, such as reading the text content of a text file. w (write): can be edited, added, or Is to modify the content of the file (but does not include deleting the file); x (execute): The file has the permission to be executed by the system. The importance of permission on the directory: www.2cto.com r (read contents in directory): indicates that you have the permission to read the directory structure list. Therefore, when you have the permission to read (r) a directory, you can query the file name data in this directory. So you can use the ls command to display the content list of this directory! W (modify contents of directory): It indicates that you have the permission to change the list of the directory structure, that is, the following permissions: Create a new file and directory; delete an existing file and directory (regardless of the permission of the file !) Rename an existing file or directory, and move the file or directory location in the directory. X (access directory): indicates whether the user can access the directory.
Author: jmbkeyes

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.