Linux File and folder Permissions

Source: Internet
Author: User

Popularize basic linux knowledge, Linux File and folder permissions. Do not lose 777 permissions. The online tutorials are too complex and lengthy. The summary is as follows...
1. View Linux File Permissions

Ls-l (General)
Ll (applicable to Ubuntu, equal to ls-al)

Ii. Permission identifier

R (read), w (write), x (execution)
4 (read), 2 (write), 1 (execution)

Note: The directory must have execution permission to read

Ii. Modify Linux File Permissions

Method 1

Chmod-r 777 dir/
-R: Change the dir directory and all the sub-files and folders in the dir directory.
777 change "file owner, user group, and other users" to read, write, and execute.

Method 2

Chmod parameters: a (user and group), u (user), g (group), 0 (other Users)
Chmod operators: + (plus),-(minus), = (assign)

Chmod + x file.txt (user, group, and other users, add execution permission)
Chmod u + x file.txt (user, add execution permission)

Iii. Linux Common File Permissions

777 (read/write execution, read/write execution, read/write execution)
755 (read/write execution, read execution, read execution)
644 (read/write, read, read)
400 (read, prohibit, or prohibit

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.