Thursday, October 17, 2013

chattr Command in Linux


chattr Command in Linux

command: chattr

usage: 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

chattr Command in Linux

No comments:

Post a Comment

Linux Tips and tricks,Online Linux Helpers