CentOS File System Command --- chattr

Source: Internet
Author: User

CentOS File System Command --- chattr
Chattr command usage

Chattr
  
1. Role
  
Modify the attributes of the ext2 and ext3 file systems and use the permission superuser.
  
2. Format
  
Chattr [-RV] [-+ = AacDdijsSu] [-v version] file or directory
  
3. Main Parameters
  
-R: recursively processes all files and subdirectories.
  
-V: displays the modified content in detail and prints the output.
  
-: Invalid attribute.
  
+: Activation attribute.
  
=: Specifies the attribute.
  
A: Atime: Tell the system not to modify the last access time of this file.
  
S: Sync. Once the application writes the file, the system immediately writes the Modification result to the disk.
  
A: Append Only. The system Only allows data to be appended to this file. No process is allowed to overwrite or intercept this file. If the directory has this attribute, the system will only allow the creation and modification of files under this directory, and will not allow the deletion of any files.
  
I: Immutable. The system does not allow any modifications to this file. If the directory has this attribute, any process can only modify the files under the Directory and cannot create or delete files.
  
D: Check for errors in the compressed file.
  
D: No dump. During file system backup, the dump program ignores this file.
  
C: Compress. The system compresses the file transparently. When reading from this file, the returned data is extracted. When writing data to this file, the data is first compressed before being written to the disk.
  
: Secure Delete: enables the system to fill in the region of the file with 0 When deleting the file.
  
U: Undelete: When an application requests to delete this file, the system will keep its data block so that the file can be deleted in the future.
  
4. Description
  
The chattr command is very useful. Some of the functions are supported by the Linux kernel version. If the Linux kernel version is earlier than 2.2, many functions cannot be implemented. Similarly, if-D is used to check the wrong function in the compressed file, the kernel 2.5.19 or later is required. In addition, modifying attributes using the chattr command can improve system security, but it is not suitable for all directories. The chattr command cannot protect the/,/dev,/tmp, And/var directories.

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.