chattr, lsattr : two commands that allow reading and modifying of
file attributes on an ext2 filesystem.
Example :
# chattr +i /etc/shadow
This command will put the "i" attribute (file cannot be modified. This includes deletion or renaming).
See 'man chattr' for detailed description on attributes.
CHATTR(1) CHATTR(1)
NAME
chattr - change file attributes on a Linux second extended file system
SYNOPSIS
chattr [ -RV ] [ -v version ] [ mode ] files...
DESCRIPTION
chattr changes the file attributes on a Linux second extended file sys‐
tem.
The format of a symbolic mode is +-=[ASacDdIijsTtu].
The operator ‘+’ causes the selected attributes to be added to the
existing attributes of the files; ‘-’ causes them to be removed; and
‘=’ causes them to be the only attributes that the files have.
The letters ‘acdijsuADST’ select the new attributes for the files:
append only (a), compressed (c), no dump (d), immutable (i), data jour‐
nalling (j), secure deletion (s), no tail-merging (t), undeletable (u),
no atime updates (A), synchronous directory updates (D), synchronous
updates (S), and top of directory hierarchy (T).
LSATTR(1) LSATTR(1)
NAME
lsattr - list file attributes on a Linux second extended file system
SYNOPSIS
lsattr [ -RVadv ] [ files... ]
DESCRIPTION
lsattr lists the file attributes on a second extended file system. See
chattr(1) for a description of the attributes and what they mean.