Tuesday, 24 December 2013

How to apply the chattr on any file or directory

Hello Friends I am Deepak Saini and today I am trying to expalin how we are using the chattr or how they works

Lets start
Chattr :- Chatter stands for the (change attributes) if we are apply the chattr then root and other users are not able to delete or modify the files .We are using the chattr to secure accidentally deletion of file or directory.

Chattr are two types
1 a
2 i

a :- when we are apply this chattr  we are able to append in the file but we are not able to delete ,modify,rename,copy on other location and when we are open the file in the editors the file is open read only.

i :- when this type of chattr aplly on the file or directory we are able to copy this file but can't append ,delete,modify,rename or move the file.

1 How to apply the chattr a on a file
syntax :- chattr +a <file path>


in this chattr is command and +a is attribute .

2 How to remove chattr a on a file
syntax :- chattr -a <file path>


 3 How to apply chattr i on the file
syntax:- chattr +i <file path>

same +i is the attribute 

4 How to remove chattr i on the file
 syntax:-chattr -i <file path>

6 How to apply the cahttr i or a on the directory
 syntax :-chattr -R +(i,a) <Dirctory path >

7 How to remove the chattr on a Directory
 syntax :- chattr -R -(a,i) <direcotry path>

Thank for reading and sorry for my R.I.P english
_/\_ Jai Hind

0 comments:

Post a Comment