View Permissions
[Ruby]View PlainCopy
- In Terminal input:
- Ls-l xxx.xxx (xxx.xxx is the file name)
- Then there will be similar messages, mostly these:
- -rw-rw-r--
[Ruby]View PlainCopy
- Which: the front one-represents the type
- The middle three rw-represents the owner (user)
- Then those three rw-represent groups (group)
- The last three r--represent others (other).
- And then I'll explain the 9 digits in the back:
- R indicates that a file can be read (read)
- W indicates that the file can be written (write)
- x indicates that the file can be executed (if it is a program)
- -Indicates that the appropriate permission has not been granted
Modify Permissions
[Ruby]View PlainCopy
- In Terminal input:
- chmod o+w xxx.xxx
- Give other people permission to write xxx.xxx this file
- chmod GO-RW xxx.xxx
- Represents the deletion of read and write permissions for groups and others in xxx.xxx
[Ruby]View PlainCopy
- U on behalf of owner (user)
- G represents the group where the owner resides
- O stands for others, but not u and g (other).
- A represents all people, including U,g and O.
- R indicates that a file can be read (read)
- W indicates that the file can be written (write)
- x indicates that the file can be executed (if it is a program)
Numbers instead
[Ruby]View PlainCopy
- Where: Rwx can also be replaced by numbers
- R------------4
- W-----------2
- X------------1
- -------------0
- Let's go:
- + means add permission
- -Indicates delete permission
- = indicates a permission to make it unique
[Ruby]View PlainCopy
- -RW-------(600) Only the owner has read and write permissions
- -rw-r--r--(644) Only the owner has read and write permissions, and the group and other people only have Read permissions
- -RWX------(700) Only the owner has read, write, execute permissions
- -rwxr-xr-x (755) Only the owner has read, write, execute permissions, groups and other people only read and Execute permissions
- -rwx--x--x (711) Only the owner has read, write, execute permissions, groups and other people only execute the permissions
- -rw-rw-rw-(666) Everyone has access to read and write
- -RWXRWXRWX (777) Everyone has access to read and write and execute
[HTML]View PlainCopy
- When executing Mkdir/nfs in the script, I found that I had already created the/nfs directory, so I got an error, and then I stuck there and asked for a solution:
- Mkdir-p/nfs
- That is, by adding the-p parameter, you only know that the directory was created recursively
View and modify file permissions under Linux