know about chattr command with its examples

  • About chattr : change file attributes on a Linux file system
  • Comes From : e2fsprogs-1.41.12-3.el6.i686

Examples:

1. To change attribute of a file to “append only”

$ chattr +a file.txt

2. To change attribute of a file to “compressed”

$ chattr +c file.txt

3. To change attribute of a file to “no dump”

$ chattr +d file.txt

4. To change attribute of a file to “exten format”

$ chattr +e file.txt

5. To change attribute of a file to “immutable”

$ chattr +i file.txt

6. To change attribute of a file to “data journaling”

$ chattr +j file.txt

7. To change attribute of a file to “secure deletion”

$ chattr +s file.txt

8. To change attribute of a file to “no tail-merging”

$ chattr +t file.txt

9. To change attribute of a file to “undeletable”

$ chattr +u file.txt

10. To change attribute of a file to “no atime updates”

$ chattr +A file.txt

11. To change attribute of a file to “synchronous directory updates”

$ chattr +D file.txt

12. To change attribute of a file to “synchronous  updates”

$ chattr +S file.txt

13. To change attribute of a file to “top of directory hierarchy”

$ chattr +T file.txt

14. To set the attributes recursively

$ chattr -R +i file.txt

15. To have verbose output

$ chattr -V

16. To supress most error messages

$ chattr -f

Leave a Reply

Your email address will not be published. Required fields are marked *