Article Title: how to change the File Permission in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Linux is a multi-user system, so the permission settings are strict. The File Permission is expressed in nine bits, and a total of ten file types are added, such as "--". In addition, 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 readable and executable. Other users can read and write but cannot execute it.