In Ubuntu if the directory is created with root privileges, a lock flag appears when displayed under normal permissions, indicating that the directory is a protected directory (read-only, cannot be written and deleted), and normal permissions cannot manipulate it.
If you create a directory dir with the command sudo mkdir dir, a lock will appear in the lower right corner of the Dir directory, and the lock flag will not appear in the lower right corner of directory dir if you create it with the command mkdir dir
It is important to note that if you are creating a directory under the main file directory, you must have sudo permissions to be able to create subdirectories in the normal directory can be directly used mkdir
Then the main file directory with the command sudo mkdir xx created directory will be protected directory, in which any operation other than read requires sudo permission, then how to change the permissions of xx file?
Method One: sudo chmod-r 777 directory name, the method on the directory recursively change the permissions to be readable writable can be run (sometimes there are security issues, may corrupt files?). )
chmod can change permissions, all subdirectories under-R directory, 777 maximum permissions (read, write, execute)
Method two: Unlock directories and subdirectories: sudo chmod a+w directory name-R
Unlock directory: sudo chmod a+w directory name
Note: Chmod-r 777 * * represents all, granting 777 permissions to all subdirectories under the current directory
The lower right corner of the directory in Ubuntu has a lock flag