The lower right corner of the directory in Ubuntu has a lock flag

Source: Internet
Author: User

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

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.