File attributes

File attributes

Sergey Abbakumov

Do you know that in Linux you can specify extended attributes for the file? For example, you can make the file undeletable so that even root can not remove it.

This is done by using the sudo chattr +i <filename> command. i denotes immutable. You can view the attributes of the file using the lsattr command. By the way, not all file systems support this and other attributes. An example of such file systems is tmpfs (although I've heard about patches in the kernel, it seems like there is even a CONFIG_TMPFS_XATTR kernel config). But in the other "standard" FS this works: ext2, ext3, ext4, XFS, ReiserFS and others.


Telegram channel: https://t.me/sea_plus_plus

Report Page