Name
chattr [options
] [+-=]attributes
[files
] — e2fsprogs
Synopsis
/usr/bin
stdin stdout - file -- opt --help --version
If you grew up with other Unix systems, you might be surprised that Linux files can have additional attributes beyond their access permissions. If a file is on an ext2 or ext3 filesystem (the Fedora default), you can set these extended attributes with the chattr
(change attribute) command and list them with lsattr
.
As with chmod
, attributes may be added (+) or removed (-) relatively, or set absolutely (=).
Attribute | Meaning |
| Append-only: appends are permitted to this file, but it cannot otherwise be edited. Root only. |
| Accesses not timestamped: accesses to this file don’t update its access timestamp (atime). |
| Compressed: data is transparently compressed on writes and uncompressed on reads. |
| Don’t dump: tell the |
| Immutable: file cannot be changed or deleted (root only). |
| Journaled data (ext3 filesystems only). |
| Secure deletion: if deleted, this file’s data is overwritten with zeroes. |
| Synchronous update: changes are written to disk immediately, as if you had typed |
| Undeletable: file cannot be deleted (undeletable). |
Useful options | |
| Recursively process directories. |
Get Linux Pocket Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.