Comments on Linux chattr Command Tutorial for Beginners (5 Examples)

Often a Linux computer is used by different users. So there is a possibility that these users access a common group of files. This opens the door to problems like accidental deletion or editing of important files, which you as an administrator definitely don't want. Fortunately, there is a command called chattr that is designed for just such cases.

2 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: stefanyu at: 2018-07-19 06:29:24

for the question:

Q1. How to use chattr command?

Suppose you want to make a file read-only. So all you have to do is to run the chattr command with +i option and the name of the file as input.

For example:

chattr -i test.txt

 

I think the commad shoud be:  chattr +i test.txt

By: till at: 2018-07-19 16:28:49

Thank you for the hint. I've corrected that in the text.