Change file permissions in linux-general Linux technology-Linux technology and application information. For more information, see. Linux is a multi-user system, so the permission settings are strict. The File Permission is expressed in nine bits. In addition, a total of ten file types are added, such, each three represents a permission, namely the owner, the owner group, and the owner. Each three represents the read, write, and execute permissions, respectively indicated by letters r, w, and x.
If a file has the permission to read and write only to its owner and only to others, the permission indicates-rwxr -- r --. If all users have the permission to read and write the file, it should be-rwxrwxrwx. It should be noted that the first-indicates the file type. Leave it empty unless discussed here.
To set file permissions, note: Read is represented by number 4, write is represented by number 2, and execution is represented by number 1. Calculate the sum before setting permissions.
For example, you need to set the read and write permissions to 4 + 2 = 6, and set all the read and write permissions to read + write + execute = 4 + 2 + 1 = 7, if you do not set the chmod permission, use the chmod command.
Usage: chmod [number indicated by permission] File Name
For example: chmod 766 myfile, this command sets the permission of the myfile file to the readable and executable, while other users can read and write but cannot execute
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.