blob: 149e6ecc87dc773fdc93658cd09baa80a86d3467 [file] [log] [blame]
Theodore Ts'o3839e651997-04-26 13:21:57 +00001.\" -*- nroff -*-
Theodore Ts'o74becf31997-04-26 14:37:06 +00002.TH CHATTR 1 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
Theodore Ts'o3839e651997-04-26 13:21:57 +00003.SH NAME
4chattr \- change file attributes on a Linux second extended file system
5.SH SYNOPSIS
6.B chattr
7[
8.B \-RV
9]
10[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000011.B \-v
12.I version
Theodore Ts'o3839e651997-04-26 13:21:57 +000013]
14[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000015.I mode
Theodore Ts'o3839e651997-04-26 13:21:57 +000016]
17.I files...
18.SH DESCRIPTION
19.B chattr
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000020changes the file attributes on a Linux second extended file system.
Theodore Ts'o3839e651997-04-26 13:21:57 +000021.PP
Theodore Ts'o2ecc6fe1997-04-29 17:57:00 +000022The format of a symbolic mode is +-=[ASacdisu].
Theodore Ts'o3839e651997-04-26 13:21:57 +000023.PP
24The operator `+' causes the selected attributes to be added to the
25existing attributes of the files; `-' causes them to be removed; and
26`=' causes them to be the only attributes that the files have.
27.PP
Theodore Ts'o2ecc6fe1997-04-29 17:57:00 +000028The letters `ASacdisu' select the new attributes for the files:
29don't update atime (A), synchronous updates (S), append only (a),
30compressed (c), immutable (i), no dump (d),
Theodore Ts'of3db3561997-04-26 13:34:30 +000031secure deletion (s), and undeletable (u).
Theodore Ts'o3839e651997-04-26 13:21:57 +000032.SH OPTIONS
33.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000034.B \-R
Theodore Ts'o3839e651997-04-26 13:21:57 +000035Recursively change attributes of directories and their contents.
Theodore Ts'oa88fa0c1999-01-05 07:02:39 +000036Symbolic links encountered during recursive directory traversals are
37ignored.
Theodore Ts'o3839e651997-04-26 13:21:57 +000038.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000039.B \-V
Theodore Ts'oa88fa0c1999-01-05 07:02:39 +000040Be verbose with chattr's output and print the program version.
Theodore Ts'o3839e651997-04-26 13:21:57 +000041.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000042.BI \-v " version"
Theodore Ts'oe1a0a3e2000-02-11 05:00:19 +000043Set the file's version/generation number.
Theodore Ts'of3db3561997-04-26 13:34:30 +000044.SH ATTRIBUTES
Theodore Ts'o2ecc6fe1997-04-29 17:57:00 +000045When a file with the 'A' attribute set is modified, its atime record is
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000046not modified. This avoids a certain amount of disk I/O for laptop
Theodore Ts'o2ecc6fe1997-04-29 17:57:00 +000047systems.
Theodore Ts'oa789d841998-03-30 01:20:55 +000048.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000049A file with the `a' attribute set can only be open in append mode for writing.
Theodore Ts'oa789d841998-03-30 01:20:55 +000050Only the superuser can set or clear this attribute.
51.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000052A file with the `c' attribute set is automatically compressed on the disk
53by the kernel. A read from this file returns uncompressed data. A write to
54this file compresses data before storing them on the disk.
Theodore Ts'oa789d841998-03-30 01:20:55 +000055.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000056A file with the `d' attribute set is not candidate for backup when the
57.BR dump (8)
58program is run.
Theodore Ts'oa789d841998-03-30 01:20:55 +000059.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000060A file with the `i' attribute cannot be modified: it cannot be deleted or
61renamed, no link can be created to this file and no data can be written
62to the file. Only the superuser can set or clear this attribute.
Theodore Ts'oa789d841998-03-30 01:20:55 +000063.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000064When a file with the `s' attribute set is deleted, its blocks are zeroed and
65written back to the disk.
Theodore Ts'oa789d841998-03-30 01:20:55 +000066.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000067When a file with the `S' attribute set is modified,
68the changes are written synchronously on the disk; this is equivalent to
69the `sync' mount option applied to a subset of the files.
Theodore Ts'oa789d841998-03-30 01:20:55 +000070.PP
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000071When a file with the `u' attribute set is deleted, its contents are saved.
Theodore Ts'of3db3561997-04-26 13:34:30 +000072This allows the user to ask for its undeletion.
Theodore Ts'oa789d841998-03-30 01:20:55 +000073.PP
Theodore Ts'o3839e651997-04-26 13:21:57 +000074.SH AUTHOR
75.B chattr
Theodore Ts'offe4cab2000-04-03 13:27:41 +000076was written by Remy Card <Remy.Card@linux.org>.
Theodore Ts'o3839e651997-04-26 13:21:57 +000077.SH BUGS AND LIMITATIONS
Theodore Ts'offe4cab2000-04-03 13:27:41 +000078As of Linux 2.2, the `c', 's', and `u' attribute are not honored
79by the kernel code.
Theodore Ts'o3839e651997-04-26 13:21:57 +000080.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000081These attributes will be implemented in a future ext2 fs version.
Theodore Ts'o3839e651997-04-26 13:21:57 +000082.SH AVAILABILITY
83.B chattr
Theodore Ts'oa789d841998-03-30 01:20:55 +000084is part of the e2fsprogs package and is available for anonymous
85ftp from tsx-11.mit.edu in /pub/linux/packages/ext2fs.
Theodore Ts'o3839e651997-04-26 13:21:57 +000086.SH SEE ALSO
87.BR lsattr (1)