chattr Command in Linux
command: chattrusage: change file attributes on a Linux file system
syntax: # chattr [ -RVf ] [ -v version ] [+-=acdeijstuADST] files...
where + add attribute
- remove attribute
= assign attributes
Examples:
1. To make a file read only
$ chattr +i sample.txt
2. To make a file again from read only to write
$ chattr -i sample.txt
3. To set open a file in append mode super user can do this
$ chattr +a sample.txt
4. To remove the above permission +a to the file
$ chattr -a sample.txt
No comments:
Post a Comment