The chattr and lsattr commands offer users a convenient way to modify and display advanced file attributes.
Most users are familiar with the usual file attributes. Desktop file managers often list them as properties: the name, path, size, and the dates that the file was created, last accessed, and last modified (Figure 1). Many, too, are familiar with the separate read, write, and execution permissions for a file’s owner, group, and other users. However, over the decades, new filesystems, as well as the needs of version control for developers, have developed additional optional attributes. These additional attributes are edited by
chattr , the equivalent for
chmod for permissions, and can be viewed by
lsattr . Both commands are included in the e2fsprogs  package and are installed by default in most distributions. While the creation of
lsattr was driven by the needs of developers, many of these additional attributes are practical for everyday use as well.
chattr and lsattr Options
The commands for working with file attributes have limited options. All options use a single letter rather than the full word like GNU style. In
-f option will suppress all except critical error messages. However, users are more likely to want
-R (recursive) to change the attributes of an entire directory or
-V (verbose) to receive instant feedback. Developers may want to use
-v VERSION together with version control, or
-p PROJECT to associate files with a particular project. For commands,
chattr uses a standard structure:
chattr [OPTIONSP [-v VERSION] [-p PROJECT] [OPERATOR][ATTRIBUTES ][FILES]
Use Express-Checkout link below to read the full article (PDF).