The linuxchattr command learns many attributes for files in the linux system. the use of these attributes is of great help to ensure the security of the system. Using these attributes helps the system administrator effectively manage the system. What are the attributes of an archive? File attributes: the linux chattr command learns many attributes for files in the linux system. the use of these attributes is of great help to ensure the security of the system. Using these attributes helps the system administrator effectively manage the system. What are the attributes of an archive? There are many file attributes. if you are not a system administrator, it is hard to remember them. In the man manual of the chattr command, you can find the detailed meaning of each attribute. just check it as needed. Sh-# man chattr has so many file attributes, of which two are used: 1. I attribute. Once the file has this attribute, the file cannot be deleted, renamed, or created as a link file, nor can it be written into the file; 2. attribute a. Once an archive has this attribute, it can only append data to the archive. These two attributes are usually used to protect important files in the system. Sh-# touch/attr_test.txtsh-# chattr + I/attr_test.txtchattr: operation not permitted while setting flags on/attr_test.txt this execution error occurs because the chattr command is only available to the root user for execution. You can use the id command to check whether the current user is a root user. Sh-# iduid = 123 (my_name) gid = 456 (ooxx) sh-# lsattr/var/log/messages it seems that my linux system is faulty, at the moment, more lab verifications cannot be performed on the root user. So the learning of chattr is temporary.
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.