← ../

Linux file attributes

you can list a file attribute of a file with the lsattr command, and change the attributes of that file with the chattr command.

the number of attributes is quite exhaustive, I will not go over all of them but two of them can be particularly useful

a A file with the 'a' attribute set can only be opened in
append mode for writing. Only the superuser or a process
possessing the CAP_LINUX_IMMUTABLE capability can set or
clear this attribute.
i A file with the 'i' attribute cannot be modified: it
cannot be deleted or renamed, no link can be created to
this file, most of the file's metadata can not be
modified, and the file can not be opened in write mode.
Only the superuser or a process possessing the
CAP_LINUX_IMMUTABLE capability can set or clear this
attribute.

sources :

https://www.man7.org/linux/man-pages/man1/lsattr.1.html

https://www.man7.org/linux/man-pages/man1/chattr.1.html