New linux users-File Permission and modification, new linux permission Modification

Source: Internet
Author: User

New linux users-File Permission and modification, new linux permission Modification

If you access or execute a file to display Permission deny, this is generally a Permission issue.

Use"ls -l"You can view the detailed information of files in this directory.

1. Read Permissions

The first column is the permission information, as shown in the following figure:

drwxr-xr-x

Or

-rwx------

And so on.

The first character indicates that the file is a directory or file, d indicates a directory,-indicates a file, and other characters such as B, c, and s.

Each of the last nine characters is divided into three groups. The first group represents the permissions of the owner, the second group represents the permissions of the user group, and the third group represents the permissions of other users.

R indicates read, w indicates write, and x indicates execution.

They are represented by a number respectively. r is 4, w is 2, and x is 1. Permissions for each identity are accumulated, so-rwx------The owner's permission is 7, and the permissions of user groups and other users are 0.

2. Modify permissions

The command for modifying permissions is chmod. Shape:

chmod -R 777 filename

This means to change the folder permission of filenamedrwxrwxrwx-R indicates recursive changes, that is, all files in the subdirectory are changed.

You can also modify it in the form of u (owner) g (User Group) o (other users), such:

chmod u=rwx,go=rx filename

The file filename is changed-rwxr-xr-x.

chmod a+w filename

This means that all three permissions of the filename file are granted with w permissions.

chmod a-w filename

This means that all three permissions of the filename file are revoked by w. Similarly.

3. Directory and File Permissions

The directory does not have the x permission, indicating that it does not have the execution permission and cannot enter the Directory through the cd command.

If you have w permissions on the directory but do not have the permissions on the files under the directory, you can still Delete this file! Because w indicates that you have the permission to change the directory, regardless of the file permission.

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.