chattr
Script error: No such module "Distinguish".
Page Module:Infobox/styles.css has no content.
| chattr | |
|---|---|
| [[Programmer|Original authorTemplate:Pluralize from text]] | Remy Card |
| Engine | Page Template:Plainlist/styles.css has no content.Template:EditAtWikidata |
| Operating system | Linux |
| Platform | Cross-platform |
| Type | Command |
| Website | Script error: No such module "WikidataIB". |
| Repository | Page Template:Plainlist/styles.css has no content.
|
Script error: No such module "Check for conflicting parameters". Page Module:Infobox/styles.css has no content.
| chflags | |
|---|---|
| Engine | Page Template:Plainlist/styles.css has no content.Template:EditAtWikidata |
| Operating system | BSD-like systems, including macOS |
| Platform | Cross-platform |
| Type | Command |
| Website | Script error: No such module "WikidataIB". |
| Repository | Page Template:Plainlist/styles.css has no content.
|
Script error: No such module "Check for conflicting parameters".
Page Template:Mono/styles.css has no content.chattr is the command in Linux that allows a user to set certain attributes of a file. Page Template:Mono/styles.css has no content.lsattr is the command that displays the attributes of a file.
Most BSD-like systems, including macOS, have always had an analogous Page Template:Mono/styles.css has no content.chflags command to set the attributes, but no command specifically meant to display them; specific options to the Page Template:Mono/styles.css has no content.ls command are used instead. The chflags command first appeared in 4.4BSD.
Solaris has no commands specifically meant to manipulate them. Page Template:Mono/styles.css has no content.chmod[1] and Page Template:Mono/styles.css has no content.ls[2] are used instead.
Other Unix-like operating systems, in general, have no analogous commands. The similar-sounding commands Page Template:Mono/styles.css has no content.chatr (from HP-UX) and Page Template:Mono/styles.css has no content.lsattr (from AIX) exist but have unrelated functions.
Among other things, the Page Template:Mono/styles.css has no content.chattr command is useful to make files immutable so that password files and certain system files cannot be erased during software upgrades.[3]
In Linux systems (Page Template:Mono/styles.css has no content.chattr and Page Template:Mono/styles.css has no content.lsattr)
File system support
The command line tools Page Template:Mono/styles.css has no content.chattr (to manipulate attributes) and Page Template:Mono/styles.css has no content.lsattr (to list attributes) were originally specific to the Second Extended Filesystem family (ext2, ext3, ext4), and are available as part of the e2fsprogs package.
However, the functionality has since been extended, fully or partially, to many other systems, including XFS, ReiserFS, JFS and OCFS2. The btrfs file system includes the attribute functionality, including the C flag, which turns off the built-in copy-on-write (CoW) feature of btrfs due to slower performance associated with CoW.
Page Template:Mono/styles.css has no content.chattr description
The form of the Page Template:Mono/styles.css has no content.chattr command is:
chattr [-RVf] [-+=AacDdijsTtSu] [-v version] files...
-Rrecursively changes attributes of directories and their contents-Vis to be verbose and print the program version-fsuppresses most error messages
Page Template:Mono/styles.css has no content.lsattr description
The form of the Page Template:Mono/styles.css has no content.lsattr command (gnu 1.41.3):
lsattr [ -RVadv ] [ files... ]
-Rrecursively lists attributes of directories and their contents-Vdisplays the program version-alists all files in directories, including dotfiles-dlists directories like other files, rather than listing their contents
Attributes
Some attributes include:
| Attribute | Page Template:Mono/styles.css has no content.lsattr flag | Page Template:Mono/styles.css has no content.chattr option | Semantics and rationale |
|---|---|---|---|
No atime updates
|
A
|
+A to set-A to clear
|
|
| Append only | a
|
+a to set-a to clear[note 1]
|
|
| Compressed | c
|
+c to set-c to clear[note 2]
|
|
| No Copy-on-Write (CoW) | C
|
+C to set-C to clear[note 3]
|
|
| Synchronous directory updates | D
|
+D to set-D to clear
|
|
| No dump | d
|
+d to set-d to clear
|
|
| Compression error | E
|
(unavailable) |
|
| Extent format | e
|
(unavailable) |
|
| Huge file | h
|
(unavailable) |
|
| Indexed directory | I
|
(unavailable) |
|
| Immutable | i
|
+i to set-i to clear[note 1]
|
|
| Data journaling | j
|
+j to set-j to clear[note 4]
|
|
| Secure deletion | s
|
+s to set-s to clear[note 2][note 5]
|
|
| Synchronous updates | S
|
+S to set-S to clear
|
|
| Top of directory hierarchy | T
|
+T to set-T to clear
|
|
| No tail-merging | t
|
+t to set-t to clear
|
|
| Undeletable | u
|
+u to set-u to clear[note 2]
|
|
| Compression raw access | X
|
(unavailable) |
|
| Compressed dirty file | Z
|
(unavailable) |
|
| Version / generation number | -v
|
-v version
|
|
Notes
Page Template:Reflist/styles.css has no content.
- ^ a b Only the superuser or a process possessing the
CAP_LINUX_IMMUTABLEcapability can set or clear these attributes. - ^ a b c These attributes are not honored by the Page Template:Mono/styles.css has no content.ext2 and Page Template:Mono/styles.css has no content.ext3 filesystems as implemented in the current mainline Linux kernels.
- ^ These attributes only make sense for Copy-on-Write file-systems such as Page Template:Mono/styles.css has no content.btrfs.
- ^ Only the superuser or a process possessing the
CAP_SYS_RESOURCEcapability can set or clear this attribute. - ^ This attribute is not honored by the Page Template:Mono/styles.css has no content.ext4 filesystem as implemented in the current mainline Linux kernels as reported in Bug #17872 Script error: No such module "webarchive"..
In BSD-like systems (Page Template:Mono/styles.css has no content.chflags)
File system support
The Page Template:Mono/styles.css has no content.chflags command is not specific to particular file systems. UFS on BSD systems, and APFS, HFS+, SMB, AFP, and FAT on macOS support at least some flags.
Page Template:Mono/styles.css has no content.chflags description
The form of the Page Template:Mono/styles.css has no content.chflags command is:
chflags [-R [-H | -L | -P]] flags file ...
-HIf the -R option is specified, symbolic links on the command line are followed. (Symbolic links encountered in the tree traversal are not followed.)-LIf the -R option is specified, all symbolic links are followed.-PIf the -R option is specified, no symbolic links are followed. This is the default.-RChange the file flags for the file hierarchies rooted in the files instead of just the files themselves.
Displaying
BSD-like systems, in general, have no default user-level command specifically meant to display the flags of a file. The Page Template:Mono/styles.css has no content.ls command will do with either the -lo, or the -lO, depending on the system, flags passed.
Attributes
All traditional attributes can be set or cleared by the super-user; some can also be set or cleared by the owner of the file. Some attributes include:
| Attribute | Page Template:Mono/styles.css has no content.ls flag | Page Template:Mono/styles.css has no content.chflags flag | Owner-settable | OS support | Semantics and rationale |
|---|---|---|---|---|---|
| Archived | Page Template:Mono/styles.css has no content.arch | Page Template:Mono/styles.css has no content.arch, Page Template:Mono/styles.css has no content.archived | No | All | File is archived |
| Opaque | Page Template:Mono/styles.css has no content.opaque | Page Template:Mono/styles.css has no content.opaque | Yes | All | Directory is opaque when viewed through a union mount |
| No dump | Page Template:Mono/styles.css has no content.nodump | Page Template:Mono/styles.css has no content.nodump | Yes | All | File cannot be dumped |
| System append-only | Page Template:Mono/styles.css has no content.sappnd | Page Template:Mono/styles.css has no content.sappnd, Page Template:Mono/styles.css has no content.sappend | No | All | Existing data in the file can't be overwritten and the file cannot be truncated |
| User append-only | Page Template:Mono/styles.css has no content.uappnd | Page Template:Mono/styles.css has no content.uappnd, Page Template:Mono/styles.css has no content.uappend | Yes | All | Existing data in the file can't be overwritten and the file cannot be truncated |
| System immutable | Page Template:Mono/styles.css has no content.schg | Page Template:Mono/styles.css has no content.schg, Page Template:Mono/styles.css has no content.schange, Page Template:Mono/styles.css has no content.simmutable | No | All | File cannot be changed, renamed, moved, or removed |
| User immutable | Page Template:Mono/styles.css has no content.uchg | Page Template:Mono/styles.css has no content.uchg, Page Template:Mono/styles.css has no content.uchange, Page Template:Mono/styles.css has no content.uimmutable | Yes | All | File cannot be changed, renamed, moved, or removed |
| System no-unlink | Page Template:Mono/styles.css has no content.sunlnk | Page Template:Mono/styles.css has no content.sunlnk, sunlink | No | FreeBSD, DragonFly BSD, macOS | File cannot be removed, renamed or mounted on; on macOS this flag needs to be set or cleared from single user mode |
| User no-unlink | Page Template:Mono/styles.css has no content.uunlnk | Page Template:Mono/styles.css has no content.uunlnk, uunlink | Yes | FreeBSD, DragonFly BSD | File cannot be removed, renamed or mounted on |
| Hidden | Page Template:Mono/styles.css has no content.hidden | Page Template:Mono/styles.css has no content.hidden | Yes | macOS | File is hidden by default in the GUI (but not in Page Template:Mono/styles.css has no content.ls) |
| Hidden | Page Template:Mono/styles.css has no content.hidden | Page Template:Mono/styles.css has no content.hidden, uhidden | Yes | FreeBSD | File might be hidden by default in some GUI desktops (but not in Page Template:Mono/styles.css has no content.ls) |
| Tracked | Page Template:Mono/styles.css has no content.tracked | Page Template:Mono/styles.css has no content.tracked | Yes | macOS | File modifications and deletions are tracked |
| Restricted | Page Template:Mono/styles.css has no content.restricted | Page Template:Mono/styles.css has no content.restricted | No | macOS | File is protected by System Integrity Protection; accompanied by the extended attribute Page Template:Mono/styles.css has no content.com.apple.rootless; flag needs to be set or cleared from Recovery Mode |
| Compressed | Page Template:Mono/styles.css has no content.compressed | Page Template:Mono/styles.css has no content. | No | macOS | File is HFS-compressed (read-only flag); not available on APFS-formatted volumes |
| Data Vault | Page Template:Mono/styles.css has no content. | Page Template:Mono/styles.css has no content. | No | macOS | Hidden privacy flag since macOS Mojave set by the core system to prohibit any access without special entitlements |
| Offline | Page Template:Mono/styles.css has no content.offline | Page Template:Mono/styles.css has no content.offline, uoffline | Yes | FreeBSD | File is offline |
| Snapshot | Page Template:Mono/styles.css has no content.snapshot | No | FreeBSD, NetBSD | File is a snapshot file (read-only flag) | |
| Sparse | Page Template:Mono/styles.css has no content.sparse | Page Template:Mono/styles.css has no content.sparse, usparse | Yes | FreeBSD | Writes of all zeroes may be written as "holes" |
| Must be archived | Page Template:Mono/styles.css has no content.uarch | Page Template:Mono/styles.css has no content.uarch, uarchive | Yes | FreeBSD | File must be archived |
See also
ATTRIB– analogous command in MS-DOS, OS/2 and Microsoft Windowschown– change file/directory ownership in a Unix systemchmod– change file access control attributes in a Unix systemcacls– change file access control lists in Microsoft Windows NT
Notes
Page Template:Reflist/styles.css has no content.
References
- Template:Man
- Template:Man
- Template:Man
- Template:Man
- Template:Man
- Template:Man (outdated; see newer version)
- Page Template:Mono/styles.css has no content.stat.h (flags section in the BSD system source code of the macOS XNU kernel)
Lua error in package.lua at line 80: module 'Module:Navbox/configuration' not found.