Chmod command to modify file and folder permissions attached to an instance

Source: Internet
Author: User
The chmod command to modify the file and folder permissions is attached with the instance syntax: in the chmod [who] [+ |-|] [mode] file name command, each option is defined as a user, that is, the owner of a file or directory. G indicates the same group of users, that is, files... run the Linux chmod command to modify the file and folder permissions with the instance syntax: in the chmod [who] [+ |-| =] [mode] file name command, the meaning of each option is u, indicating "user", that is, the owner of the file or directory. G indicates "group users", that is, all users with the same group ID as the file owner. O indicates "other (others) users ". A indicates "all (all) users ". It is the default value of the system. The operation symbol can be: + add a permission. -Cancel a permission. = Grant the given permission and cancel all other permissions (if any ). Set the permissions expressed by mode to any combination of the following letters: r readable. W writable. X executable. X adds the x attribute only when the target file is executable to some users or the target file is a directory. S sets the owner or group ID of the process to the file owner during File execution. In the format of "u + s" to set the user ID of the file, and "g + s" to set the group ID. T save the program text to the swap device. U has the same permissions as the file owner. G. users in the same group have the same permissions as file owners. O has the same permissions as other users. For example, to change the index.html file to writable and executable: the code is as follows: chmod 777 index.html: the code is as follows: chmod 777 *. * replace the folder name with the suffix. For example, modify the attributes of all htm Files: The code is as follows: chmod 777 *. to modify the directory/images/xiao to writable and readable, run the following code: chmod 777/images/xiao: chmod 777 * replace the folder name with * to modify the attributes of all files and folders and subfolders in the folder to be writable and readable. the executable code is as follows: chmod-R 777/upload summarizes the differences between the permissions of directories and files in linux: Reading File content (r), writing data to a file (w), and serving as a command execution File (x ). Directory: read the file name (r) in the directory and write information to the Directory (add and delete the link to the index point) search for a directory (you can use the directory name as the path name to access the files and subdirectories it contains) specifically: (1) Users with read-only permission cannot access the directory with cd: you must have the execution permission to access. (2) users with execution permissions can access files in the directory only when they know the file name and have the read right. (3) You must have the read and execute permissions to list the directories in ls or use the cd command to enter the directories. (4) you have the write permission for a directory. you can create, delete, or modify any files or subdirectories in the directory, even if the file or subdirectory belongs to another user.

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.