Dave's Brain

Browse - Computer Tips - How can I make a file undeletable?

Date: 2014jun18
OS: Linux
Keywords: protect

Q.  How can I make a file undeletable?

A.  Use "chattr +i" like this:

% touch test % chattr +i test % rm test rm: cannot remove "test": Operation not permitted
The +i flag of chattr makes a file immutable. Its handy for important files.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.