Linux basic Commands--managing the properties of directories and files

Source: Internet
Author: User

One, view the properties of directories and files

1,ls command

Command format: LS "options" directory or file

    • -L: Output in long format

    • -D: View the properties of a directory

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M00/7C/EB/wKioL1bcLh7S7DEFAAArvRonNjk018.jpg "title=" 1.jpg " alt= "Wkiol1bclh7s7defaaarvronnjk018.jpg"/>

The meaning of the attribute in:

    • 1th character: Indicates the type of file, "D" Directory, "B" block device file, "C" character device file, "-" Normal file, "I" link file

    • 第2-4 Character: Represents the owner of a file's access rights to the file (U)

    • 第5-7 character: Represents the user's access rights to the file for a group of files (g)

    • 8th to 10th character: represents the access rights of other users to the file (O)

    • 11th character: Here's "." Related to SELinux

Permission to mark:

    • R: Indicates read permission, can be replaced by number 4

    • W: Indicates write permission, can be replaced by number 2

    • X: Represents the permission to execute, the number 1 can be used instead


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/7D/0E/wKioL1bfmVei3PiWAABdCHu7Y38488.jpg "title=" 2.jpg " alt= "Wkiol1bfmvei3piwaabdchu7y38488.jpg"/>


Second, set permissions for directories and files

1.chmod "Ugoa" "+-=" "rwx" file or directory

U is the owner of the file or directory, G is a group of files or directories, O for other users, a for all users

2.chmod nnn file or directory (n is the number that corresponds to the permission)

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/7D/0F/wKioL1bfndiwVQZCAADzmrcmhv8876.jpg "title=" 4.jpg " alt= "Wkiol1bfndiwvqzcaadzmrcmhv8876.jpg"/>


650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/7D/0F/wKioL1bfoLWhBgddAABe9xBlQpY819.jpg "title=" 5.jpg " alt= "Wkiol1bfolwhbgddaabe9xblqpy819.jpg"/>


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/7D/0F/wKioL1bfoZriRYuzAABYE0Cb-YE426.jpg "title=" 6.jpg " alt= "Wkiol1bfozriryuzaabye0cb-ye426.jpg"/>


Third, set the directory and document ownership

1.chown owner: A group file or directory

Note: When you set up a generic group, you need to use ":" To separate the genus Group, using ": Belong to Group"

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/7D/11/wKiom1bfop6x9ZDyAACR7W9kGZI555.jpg "title=" 7.jpg " alt= "Wkiom1bfop6x9zdyaacr7w9kgzi555.jpg"/>


This article is from the "New Start" blog, so be sure to keep this source http://yuanshuai.blog.51cto.com/10539781/1749074

Linux basic Commands--managing the properties of directories and files

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.