Linux chmod usage

Source: Internet
Author: User
Command name: chmod permission: usage of all users: chmod [-CFVR] [-- help] [-- version] mode file... note: The file calling permissions for Linux/Unix are divided into three levels: file owner, group, and others. Chmod can be used to control how files are called by others. Parameter: Mode: permission setting string. Format: [ugoa...] [[+-=] [rwxx]...] [,...], U indicates the owner of the file, G indicates that the owner of the file belongs to the same group, O indicates that the owner of the file belongs to other people, and a indicates that all three are. + Adds a permission,-Indicates canceling the permission, and = indicates a unique permission. R indicates that the file can be read, W indicates that the file can be written, and X indicates that the file can be executed only when the file is a subdirectory or the file has been set to executable. -C: if the permission of the file has been changed, the change action is displayed.-F: if the permission of the file cannot be changed, do not display the error message-V: show Details of permission change-R: perform the same permission change on all files in the current directory and sub-directories (that is, change one by one in the way of delivery) -- help: show auxiliary instructions -- version: Show version example: Set the file file1.txt to everyone to read: chmod Ugo + R file1.txt set the file file1.txt to everyone to read: chmod A + R file1.txt sets the archive file1.txt and file2.txt as the owner of the archive, which can be written to the same group to which the archive belongs, but cannot be written to other people: chmod ug + W, o-w file1.txt file2.txt set ex1.py to run: chmod U + x ex1.py to run all files and sub-files in the current directory The directory is set to readable by anyone: chmod-r a + R *. In addition, chmod can also use numbers to indicate permissions. For example, chmod 777 File Syntax is: chmod ABC file where A, B, C is a number, indicating the permissions of the user, group, and other respectively. R = 4, W = 2, x = 1 if you want the rwx attribute, 4 + 2 + 1 = 7; if you want the RW-attribute, 4 + 2 = 6; if you want the R-x attribute, 4 + 1 = 7. Example: chmod A = rwx file and chmod 777 file have the same effect as chmod ug = rwx, O = X file and chmod 771 file have the same effect. If chmod 4755 filename is used, this program has the root permission.

From http://zhidao.baidu.com/question/25783493.html&__bd_tkn__=23fd433b7c35806a4d10a2708da03eae95269ba28078338d51fed8133ea5c69d362ad36bb4bcda3b39bb3949f6bbe47087ac3af56e60b1f4e7eb60157a59fa3a9e63a0fb40491fc7006f357ea435b07a4a029e760b2acbfca244470e7c28475fbc670f423bb2aea3990beabbc9da8808c23123ff46

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.