Linux chattr Command Detailed

Source: Internet
Author: User

Common Command Parameters
A: Atime, tell the system not to modify the last access time for this file. S: That is, sync, once the application writes to the file, the system immediately writes the result of the modification to the disk. A: Append only, the system only allows appending data after this file, and does not allow any process to overwrite or truncate the file. If the directory has this attribute, the system will only allow the file to be created and modified in this directory, and no files are allowed to be deleted. B: Do not update the last access time of the file or directory. C: Compress the file or directory and store it. D: When the dump program executes, the file or directory will not be backed up by dump. D: Check for errors in the compressed file. I: That is immutable, the system does not allow any modification to this file. If the directory has this attribute, then any process can only modify files under the directory, not allow the creation and deletion of files. S: Delete the file completely, not recoverable, because it is deleted from disk, and then fills the area with 0 files. U: When an application requests the deletion of this file, the system retains its data block so that it can be recovered later to delete the file, to prevent accidental deletion of files or directories. T: The file system supports tail merge (tail-merging). X: The contents of the compressed file can be accessed directly.
Common Command Display


  Chatter: Lock files, cannot be deleted, cannot change
        +a:  can only add content to files, but cannot be deleted.
              chattr +a /etc/passwd
       -d:      cannot be deleted
         Locking: Chattr +i /etc/passwd       file cannot be deleted, cannot be changed, cannot be moved
        View Lock: lsattr/etc/passwd      file Adds a parameter I means lock
        Unlock: chattr-i/home/omc/h.txt   -means release
         Hide chattr command:

Which chattrmv/usr/bin/chattr  /opt/ftl/cd/opt/ftl/  mv chattr H    -To change command, use alias h to hide identity/opt/ftl/h +i/home/ Omc/h.txt--   Drive chattr command with H
Lsattr/home/omc/h.txt--    View encryption information

Recover hidden commands

Linux chattr Command Detailed

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.