Linux File and folder permissions

Source: Internet
Author: User

I used to learn a little bit about Linux in the past, and now I know it only on some small white commands. Think I just do not do server-side development should not touch it, work to know how much to do the development or familiar with some Linux, at least your project will be deployed on the Linux server it. What I didn't understand before is still going to take time to return . No more nonsense ~

Small white like me in the Linux system to view the file directory is generally used LS, in fact, we can use LL (ouch) or ls-l to see more information. For example, show the following:

The leftmost section shows the permissions for the operation of the file or folder, where:

First there are three kinds of permissions here, R is readable (read), W indicates write (write), X is executable (I guess not execute);-Indicates that the corresponding permission has not been granted

The first bit represents the type, the file is-and the folder is D

The next three bits represent the permissions of the file owner, such as rw-on the first line, three for the group, and the last three for other people (other).

The second line, and so on, simply represents the permissions of a folder

Sometimes working with colleagues, others are required to manipulate the files in your directory for convenience. We need to modify the permissions of some files.

You can modify the permissions of a file by using the chmod command at the terminal such as:

chmod A +w b.txt

Represents the Add Write permission (W) to everyone on the B.txt file, where a means that everyone all,+ to add permissions. In addition, the parameter a can be changed to O or G, representing others (other) and groups (group), respectively.

If we want to take back this permission, use the-number.

chmod A-w b.txt

What if we want to bulk modify the permissions of the file under the folder? Folders can be recursively operated-R

chmod -r +W code

In addition, since the privilege is a three-bit three-bit representation, it can be converted to three bits per 8 decimal notation. -Indicates that this bit is 0

You can use the following to assign permissions:

chmod -R 777 Code

777 means rwxrwxrwx, which gives everyone permission to read and write and execute.

Linux File and folder permissions

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.