Fact-checked by Grok 2 weeks ago

chattr

chattr is a command-line in operating systems designed to change the attributes of files and directories on supported file systems, such as ext2, ext3, ext4, and others like Btrfs and XFS. These attributes extend beyond standard Unix permissions by enforcing specific behaviors, such as preventing modifications or deletions, to enhance file security and integrity. Developed as part of the package, chattr works in conjunction with the lsattr command, which lists , and is typically used by system administrators to protect critical system files from accidental or unauthorized changes. The command operates using a symbolic mode format of +-=[aAcCdDeFijmPsStTux] (and additional read-only attributes like E for encrypted), where operators + add, - remove, and = sets exactly the specified attributes. Key options include -R for recursive application to directories, -V for verbose output showing the file system version, and -f to suppress most error messages. Not all attributes are supported across every file system; for instance, the immutable flag (i) makes a file undeletable and unmodifiable even by the root user until the attribute is removed, while the append-only flag (a) permits appending data but prohibits overwriting or truncation. Other notable attributes include A (do not update access times), c (compress file), and j (enable data journaling for ext3/ext4). In practice, chattr is invaluable for securing configurations like /etc/passwd or log files against tampering, but its effects persist only as long as the file system supports them and the attributes remain set. Users must have appropriate privileges, typically root access, to alter attributes, and compatibility depends on the underlying kernel and file system implementation, as detailed in man pages for specific file systems like ext4(5) or xfs(5).

Overview

Purpose and Functionality

chattr is a command-line utility in that modifies on supported filesystems, enabling restrictions on operations such as deletion, modification, or appending to enhance and . These attributes provide a layer of protection beyond standard , allowing administrators to make files immutable or , which prevents changes even from privileged users unless the attribute is explicitly removed. The primary use cases for chattr include safeguarding critical system files and from accidental or unauthorized alterations, which is essential in environments requiring high , such as servers or compliance-regulated systems. For instance, setting the immutable attribute on binaries or configuration files ensures they cannot be modified or deleted, mitigating risks from or . Additionally, the append-only attribute is commonly applied to log files to enforce tamper-evident recording, where new entries can be added but existing content remains unalterable, supporting auditing and forensic analysis. chattr attributes interact with by overriding them in specific ways; for example, an immutable file cannot be altered regardless of user privileges, though setting or unsetting attributes typically requires access or appropriate capabilities. This mechanism aids in enforcing policies where standard tools like are insufficient. Companion commands, such as lsattr on or equivalents on BSD-like systems, allow viewing these attributes without modification.

Historical Background

The origins of user-settable file flags trace back to 4.4BSD, where the chflags utility was introduced to enable modification of on the (UFS), providing mechanisms for enhanced security and handling in multi-user setups. This development, part of the Berkeley Software Distribution's evolution in the early , allowed administrators to set flags such as immutable and to protect files from unauthorized changes, addressing the increasing complexity of shared computing environments. In , the chattr utility emerged in 1993 as part of the package developed by Rémy Card for the filesystem, drawing inspiration from BSD's chflags but tailored to the kernel's inode structure for efficient attribute management. This adaptation supported per-file behaviors like immutability directly within the second extended filesystem, filling a gap in early for robust file protection without relying on external tools. The evolution of chattr continued with the advent of in 2001, which introduced journaling for reliability along with the 'j' flag to enable data journaling on supported filesystems. Support extended to advanced filesystems like from 2009 onward, as the filesystem was integrated into the starting with version 2.6.29, enabling flags such as no-copy-on-write for better performance in environments. These advancements were driven by the escalating demands for file integrity in multi-user and networked systems, particularly to counter threats like and that target modifiable files.

Linux Implementation

Supported Filesystems

The chattr command and its attributes are primarily supported on filesystems that implement via the ioctl , with varying levels of attribute enforcement depending on the filesystem implementation. As of 2025, core support exists for , , and filesystems, where most attributes like immutable (i), append-only (a), and no-atime-updates (A) are fully honored, though features like (c), secure-deletion (s), and undeletable (u) are not implemented in current kernels. Advanced filesystems such as provide broader attribute support, including (c) and no-copy-on-write (C), but with conflicts (e.g., c and C cannot coexist) and requirements like new files for C. enforces immutability (i) and append-only (a) at the level, though some operations like snapshots may interact with attributes. supports key attributes including a, A, d, i, and S, with strong enforcement for security flags like immutable, but lacks support for or journaling per-file (j). (Flash-Friendly File System) similarly supports (c) alongside standard flags, optimized for storage. Non-native filesystems like FAT, NTFS, or network filesystems (e.g., NFS) do not support chattr attributes, returning errors such as EOPNOTSUPP, as they lack the necessary kernel hooks. Compatibility can be verified using lsattr or filesystem-specific man pages, and support may evolve with kernel updates.

chattr Command Details

The chattr command modifies file attributes on supported Linux filesystems, with its basic syntax given by chattr [ -RVf ] [ -v version ] [ mode ] files..., where mode consists of an operator (+ to add attributes, - to remove them, or = to set exactly the specified ones) followed by one or more attribute letters such as a, c, d, i, s, t, u, A, D, I, S, or T. This operator-based approach allows precise control over attribute changes without affecting unspecified ones when using + or -. Key options include -R for recursive application to directories and their contents, -V for verbose output that displays the program and details each change, -f to suppress most error messages and continue processing, and -v version to set a specific file number for versioning-aware filesystems. These options enhance usability in complex scenarios, such as bulk operations on directory trees. Most chattr operations require root privileges or the CAP_FOWNER to bypass file ownership permission checks, with certain attributes like immutable (i) additionally needing CAP_LINUX_IMMUTABLE. For non-root users, elevation via is common, as in sudo chattr +i /etc/[resolv.conf](/page/Resolv.conf) to protect a from modification. Common errors include EOPNOTSUPP, indicating the filesystem lacks support for the requested attribute (e.g., on non-ext4 volumes), and EPERM for insufficient privileges when attempting changes without proper elevation. Users can diagnose issues by running chattr --help for syntax guidance or employing strace chattr +i file to trace system calls and identify underlying failures. The command returns an exit code of 0 on success and 1 on failure, facilitating integration into shell scripts for automated tasks, such as batch-applying the immutable flag: for file in /path/to/files/*.log; do chattr +i "$file" && [echo](/page/Echo) "Set immutable on $file" || [echo](/page/Echo) "Failed on $file"; done.

lsattr Command Details

The lsattr command is a utility used to display set on files and directories within supported filesystems, providing a read-only view of these flags without modifying them. It is part of the package and operates specifically on , , and filesystems, where these attributes control behaviors such as immutability or append-only access. The basic syntax of the lsattr command is lsattr [-RVadlpv] [files...], where optional flags modify its behavior and files... specifies one or more files or directories (defaulting to the current directory if omitted). Key options include -a to list all files, including those starting with a dot ( files); -R for recursive traversal of directories and their contents; -d to treat directories like regular files without recursing into them; -v to display the file's version or generation number; -l for a long listing format with descriptive attribute names; and -p to show the file's project number if supported. For example, running lsattr -a -R /home would recursively list attributes for all files, including ones, in the /home directory. The output of lsattr consists of a fixed-length string of characters representing the attributes, followed by the filename or path. This string, typically 20-24 characters long, uses uppercase or lowercase letters to indicate set attributes in specific positions, with dashes (-) filling unset positions; for instance, ----i--------e-- /example.txt shows the immutable flag (i in the fifth position) and the extents format flag (e in the twelfth position). To interpret the flags, users refer to the positions corresponding to each attribute, such as the fifth position for immutability (preventing modifications or deletion) or the first position for append-only mode; the exact mapping and meanings of these attributes are detailed in the File Attributes section. For complementary information like timestamps or permissions, combining lsattr with the stat command is useful, as in lsattr file.txt && stat file.txt. The lsattr command has limitations tied to filesystem support; it returns no output or an error (e.g., "Inappropriate ioctl for device") for files on unsupported filesystems like , , or , as these do not implement the same extended attributes. It also cannot display or interpret read-only kernel-set flags like extents (e) or indexed directories (I), which appear in the output but cannot be altered. In practice, lsattr can be combined with the find command for bulk attribute checks during audits, such as find /var/log -exec lsattr {} \; | [grep](/page/Grep) 'i' to identify immutable log files across a directory tree.

File Attributes

The file attributes manipulated by the chattr command in extend traditional file permissions by enforcing specific behaviors at the filesystem level, such as immutability and , to enhance , , and . These attributes are not universally supported across all filesystems and often require privileges to set or modify, with effects varying by implementation. As of 2025, the primary attributes include immutable, , and others, each tailored for particular use cases like protecting critical system files or optimizing backups. The immutable ('i') attribute prevents any modifications to a or directory, including writing, deleting, renaming, or linking, even by the user unless they possess the CAP_LINUX_IMMUTABLE . This makes it ideal for safeguarding sensitive files like /etc/passwd against accidental or malicious changes. The attribute overrides other settings, such as , rendering the file completely unchangeable while set. Supported on filesystems including , , , , and . The append-only ('a') attribute allows data to be appended to a but prohibits overwrites, deletions, or truncations, making it suitable for files where sequential writes are needed without altering existing content. When combined with immutable ('i'), the immutable restriction takes precedence, blocking appends as well. This attribute is supported on , , , , and , among others. The no-dump ('d') attribute marks a or to be excluded from backups performed by the dump utility, helping to save space and time in archival processes by skipping non-essential . It has no effect on other backup tools and is supported across , , , and similar filesystems. The synchronous ('S') attribute ensures that metadata updates for the file or directory are written to disk immediately, rather than being deferred, which minimizes the risk of metadata corruption in the event of a system crash or power failure. This is particularly useful for critical requiring high reliability and is supported on , , , , and . The compression ('c') attribute enables automatic transparent compression of file on write, decompressing it on read to save disk space; however, it is not honored on , , or filesystems in current kernels and is primarily supported on and . It conflicts with the no-copy-on-write ('C') attribute on . The no-atime-updates ('A') attribute disables updates to the file's access time (atime) upon reads, reducing unnecessary disk I/O and improving performance on read-heavy workloads, such as web servers. It is supported on , , , , and . The undeletable ('u') attribute instructs the filesystem to save a file's contents when deleted, allowing potential restoration via tools like debugfs or dump, which aids in preventing permanent from accidental deletions. However, this attribute is not honored on , , or in current kernels and has limited practical support. It requires integration with backup utilities for . The secure-deletion ('s') attribute causes the filesystem to overwrite a file's blocks with zeros upon deletion, aiming to prevent from free space; support varies and is not honored on , , or in current kernels, limiting its utility to other filesystems like older implementations. The index ('I') attribute enables hashed indexing for directories to track changes efficiently, facilitating faster searches and indexing operations similar to JFS functionality, though its use is limited to specific scenarios like database directories. It is read-only and primarily supported on , with display via lsattr. The journaled ('j') attribute activates journaling for the file, ensuring both and are logged before writes to enhance ; it is a feature from and is deprecated in , where full = options are preferred instead. Supported only on and with =ordered or =writeback modes. Attribute interactions can lead to combined effects, such as immutable ('i') overriding ('a') to block all changes. users can generally remove most attributes using chattr with the appropriate operator (e.g., -i), though certain scenarios involving filesystem s or capabilities may require additional steps like remounting, but no is typically needed for standard . Support for these attributes depends on the underlying filesystem, with offering broad but not universal compatibility as of 2025.

BSD-like Implementations

Supported Filesystems

In BSD-like operating systems, the chflags utility and underlying provide full support for file flags on traditional filesystems such as UFS1 and UFS2, which have natively accommodated all available flags since their origins in 4.4BSD. These filesystems store and enforce flags like immutable (schg) and append-only (uappend) without restrictions, relying on kernel-level checks for operations such as deletion or modification. UFS variants remain the baseline for complete flag compatibility in environments prioritizing legacy BSD behavior. Support on , the advanced copy-on-write filesystem widely used in , is partial as of 2025 implementations. Flags such as schg for system immutability are fully enforced, preventing changes even by root under elevated securelevels, while uappend enables append-only access but with limitations in enforcement during certain ZFS-specific operations like snapshots or clones. 13 and subsequent releases have introduced enhancements, including better integration for jail environments and resolution of prior "operation not supported" errors for common flags, though some user-level flags like uunlink remain unsupported on ZFS datasets. macOS, based on the kernel, offers full support on legacy HFS+ volumes, where all chflags operations persist and are enforced consistently. In contrast, the default APFS filesystem provides partial support; flags like uchg (user immutable) are retained across copies and backups, ensuring protection against unintended changes, but others such as opaque are restricted to contexts and lack broader applicability. This partial implementation stems from APFS's focus on snapshots and over traditional Unix flag semantics. DragonFlyBSD's and filesystems support essential flags including schg for immutability and uappend for append-only mode, allowing chflags operations directly on files and directories even in offline recovery scenarios. However, non-native filesystems like , , and network-mounted volumes such as NFS do not support chflags at all, returning errors like EOPNOTSUPP since flags cannot be propagated or enforced over these protocols. A key limitation is that file flags are strictly local to the host filesystem and not enforced across network shares; verification can be performed via queries for parameters or by reviewing chflags(2) for filesystem-specific notes. In containerized setups, such as jails, flags may be ignored or unsettable by default due to layers, requiring explicit enabling (e.g., allow.chflags=1 in jail parameters) for enforcement.

chflags Command Details

The chflags command in BSD-like systems modifies file flags, which impose restrictions on files beyond standard permissions. Its basic syntax is chflags [-R] flags file ..., where flags specifies the attributes to set or clear using either symbolic names (e.g., schg for system immutable) or values (e.g., 0x2000 for the same immutable flag). Symbolic flags are typically comma-separated keywords, with a no prefix (e.g., nouchg) to unset them; notation allows bitwise operations for precise control. Key options include -R for recursive application to directory hierarchies, which changes flags on all files and subdirectories unless modified by symlink-handling flags like -H (follow command-line symlinks), -L (follow all symlinks), or -P (do not follow symlinks, the default). Some implementations provide -h to modify the flags of symbolic links themselves without following them, though this is mutually exclusive with -R in certain variants; a standard help option like --help is available in many but not universally documented as -h. No verbose flag is standardized across all BSD-like systems, though -v appears in and macOS for output detailing changes. Privilege requirements distinguish user-settable flags (prefixed u, such as uchg for user immutable or uappnd for user ) from system flags (prefixed s, such as schg or sappnd), where file owners or superusers can set the former, but only superusers can set or clear the latter. Attempts to violate these rules result in an EPERM (operation not permitted) error. Additionally, clearing certain system flags like schg or sappnd may require the system to be in or at securelevel 0, enforced by the to prevent tampering even by . Error handling includes ENOTSUP (operation not supported) when the underlying filesystem does not implement file flags, such as on non-native volumes like NFS without extensions. For handling symbolic links without dereferencing, the lchflags variant of the underlying (or equivalent command options like -h) allows setting flags on the link itself rather than its target, avoiding traversal errors on unsupported paths. Variants differ slightly across implementations: supports verbose output (-v) and cross-mount restrictions (-x), with broader owner privileges for user flags; OpenBSD enforces stricter requirements for device files and relies heavily on securelevel for immutability, limiting non-root changes more rigidly; macOS, based on , includes additional flags like hidden for Finder visibility but maintains similar syntax and privilege models, without a distinct -N option—instead using -P or -h for nofollow behavior.

Displaying File Flags

In BSD-like systems, the primary method for displaying file flags is through the command with specific options. On and , the ls -lo option produces a long-format listing that includes the file flags as a string appended to the end of each line, such as "schg" for the system immutable flag. For macOS, the equivalent is ls -lO (capital O), which similarly displays the flags in the output, for example showing "schg" for an immutable . These flags appear after the standard permission, owner, group, and size information, providing a human-readable summary of attributes like immutability or no-dump status. For more detailed or programmatic access, the stat(1) utility can be used to retrieve file flags. In FreeBSD and NetBSD, stat -f "%f %N" outputs the flags in octal numeric mode (e.g., 1024 for certain user flags) alongside the filename, allowing precise bitmask inspection via the st_flags field from the underlying stat(2) system call. On OpenBSD, stat -f "%f" provides similar octal representation. For parsing in C programs, the fflagstostr() function converts the numeric flags to a comma-separated string (e.g., "schg,arch") for easier interpretation, as defined in <sys/stat.h>. This approach is useful for scripts or applications needing to decode flags without relying on ls output formatting. To view flags recursively across directories, the find command can be combined with ls -lo, such as find . -exec ls -lo {} \;, which executes the listing on each file and subdirectory. Custom scripts may further process this output, for instance, using awk to extract and report only flagged files. Flags are typically prefixed in string representations to indicate (capitalized, e.g., "Schg") versus (lowercase, e.g., "uchg") types, aiding quick identification of immutable or attributes as detailed in the available flags section. Viewing file flags has certain limitations depending on the filesystem and permissions. Standard tools like and require execute (search) permission on parent directories but do not need ownership of the file itself; however, certain system flags may only be fully interpretable or modifiable by root, though they remain visible to all users who can stat the file. On filesystems in , while file flags are generally supported and viewable via ls -lo or stat, extended ZFS-specific properties (unrelated to BSD flags) require zfs get for inspection, such as dataset-level attributes.

Available Flags

In BSD-like systems, file flags set via the chflags command are divided into user flags, which can be modified by the file owner or , and system flags, which require privileges and often additional restrictions for removal. User flags include uchg (user immutable), which prevents the owner from modifying, renaming, or deleting the , and uappend (user append-only), which allows the owner to append data but prohibits overwriting, , or deletion. These flags provide protection against accidental or unauthorized changes by the owner while permitting administrative override. System flags offer stronger enforcement and include schg (system immutable), which blocks all modifications, deletions, or renames even by the unless the system is booted into or the kernel securelevel is reduced to 0, and sappnd (system append-only), which restricts operations to appending only, with similar elevated removal requirements. Other flags transcend this distinction: nodump excludes the file from backups performed by tools like dump, opaque marks a as opaque in union mounts to hide underlying layers from visibility and traversal, and archived serves as an indicator that the file has been backed up, aiding in archive management. Flag enforcement occurs at the kernel level through the chflags(2) , which validates privileges before applying changes; flags require or access, while flags demand status and may fail if the prevents it. Removal of a flag similarly requires matching privileges, ensuring that protections cannot be bypassed without appropriate authority. For layered , combining schg with uchg protects against both owner-level and root-level actions, as the flag overrides -level permissions. Implementations vary across BSD derivatives: includes a hidden flag that conceals files from graphical interfaces while remaining visible in the terminal, and macOS introduces a restricted flag enforced by (SIP) on critical system files, preventing modification even by root without disabling SIP. Not all flags are fully supported on every filesystem; for instance, on macOS's APFS, nodump is ignored since the dump utility is obsolete and not included.

Comparisons

Differences Between Linux and BSD

The syntax of the chattr command in differs significantly from that of chflags in BSD systems. In , attributes are manipulated using operators such as + to add, - to remove, or = to set exactly, combined with single-letter flags (e.g., chattr +i file to make a file immutable). In contrast, BSD's chflags employs symbolic flag names (e.g., chflags schg file for system immutable) or / values (e.g., chflags 0x2000 file), without explicit add/remove operators, allowing direct setting or clearing via prefixes like no (e.g., chflags noschg file). This reflects 's ioctl-based versus BSD's dedicated chflags(2) syscall. Linux's file attributes encompass a broader than BSD's flags, incorporating performance-oriented options alongside mechanisms. For instance, Linux supports flags like A (no access time updates to reduce I/O overhead), c (automatic for storage efficiency), and S (synchronous metadata updates for ). BSD implementations, however, prioritize immutability and behaviors with bifurcated privileges, such as schg (system immutable, -only) and uchg (user immutable, owner or ), alongside sappnd (system ) and uappnd (user ), emphasizing layered over optimization. These distinctions stem from 's ext4/ focus on versatile filesystem tweaks versus BSD's UFS/ emphasis on restricted access controls. Enforcement mechanisms highlight philosophical divergences in root privileges and system hardening. attributes are kernel-enforced at the filesystem level but remain removable by using chattr -i, allowing administrative override without additional barriers. In BSD, the schg flag provides stricter protection: once set by , it cannot be cleared unless the kernel securelevel is reduced to 0 () or below, often requiring a , thereby safeguarding against even root-level modifications like those from rootkits. This securelevel integration in BSD (levels 1+ enforce schg irrevocably in multi-user mode) contrasts with 's capability-based model (e.g., CAP_LINUX_IMMUTABLE for immutable flags), prioritizing flexibility over absolute tamper resistance. Portability between the two systems is limited due to incompatible interfaces and semantics. Linux lacks the chflags syscall, relying instead on ioctl(FS_IOC_SETFLAGS) for chattr, preventing direct BSD application without tools like attr(1), which partially mimic BSD behaviors but fail on privilege splits or securelevel dependencies. Conversely, BSD does not natively support 's extended attributes like compression or no-CoW. On shared filesystems like , partial compatibility exists—e.g., immutable s may persist across and hosts—but full interoperability requires identical versions and avoids conflicting s, as chattr operations can fail on BSD-mounted pools. Use cases diverge accordingly, with leveraging chattr for in dynamic environments, such as setting A on log directories to minimize atime updates and SSD wear, or S on databases for immediate syncs to enhance reliability without full filesystem remounts. BSD's chflags, however, targets rigorous security scenarios, like applying schg to binaries or logs to thwart installations that attempt root-owned alterations, integrating with securelevels for boot-time integrity checks. This Linux emphasis on operational efficiency versus BSD's security-first paradigm underscores their respective evolutions from tools and traditional Unix heritages. As of 2025, continues advancing (CoW) integration via the C (no-CoW) attribute, now widely supported in and other CoW filesystems for database workloads to avoid fragmentation penalties, with enhancements improving efficiency in hybrid setups. In BSD, flag handling has stabilized through updates, aligning with 14.3's security refinements for multi-OS environments.

Support in Other Systems

In and its derivative distributions, there is no direct equivalent to the chattr command for setting such as immutability on individual files. Instead, uses system extended attributes managed via the command with special flags like S+ci to render a file immutable, preventing modifications or deletion even by . This approach is ACL-focused for but extends to attributes like append-only (S+ai) or no-modify (S+ni). For dataset-level protection, the readonly property can be enabled with zfs set readonly=on, making the entire filesystem or volume read-only. -based systems, such as those using , support similar properties for readonly enforcement but rely on the same underlying attribute mechanisms inherited from . In AIX, the chattr and lsattr commands are provided for managing Object Data Manager (ODM) attributes on devices and logical volumes, not for filesystem-level like immutability. However, the GPFS (General Parallel File System) in AIX supports immutable and attributes for files. File protection in AIX is handled through Access Control Lists (ACLs) via commands such as aclput and aclget, which allow fine-grained permissions beyond standard mode bits, or JFS2 filesystem features including extended attributes, quotas, and storage extents to restrict modifications and access. HP-UX lacks a direct equivalent to chflags or chattr for setting extended file flags like immutability on filesystems such as HFS or JFS. File protection relies on standard Unix permissions, ACLs (via commands like setfacls), and filesystem mount options, without native support for immutable or append-only attributes on individual files. , being based on the , supports chattr on partitions where the utility is available in rooted or custom environments, allowing attribute changes like immutable flags on user-accessible storage. However, SELinux mandatory access controls strictly restrict chattr operations on protected partitions such as , enforcing contexts that prevent unauthorized attribute modifications to maintain system integrity. In systems lacking native chattr support, alternatives include Access Control Lists managed with setfacl to deny write or delete permissions, extended user attributes set via setfattr for custom metadata (though not enforcing immutability), or filesystem-level mounts with options like -o ro for read-only access and noexec to block execution. The absence of a unified standard stems from specifications, which define only basic file modes via but omit extended attributes or immutable flags, resulting in proprietary vendor extensions across implementations.

References

  1. [1]
    chattr(1) - Linux manual page - man7.org
    chattr changes the file attributes on a Linux file system. The format of a symbolic mode is +-=[aAcCdDeFijmPsStTux].
  2. [2]
  3. [3]
    chattr - change file attributes on a Linux file system - Ubuntu Manpage
    The 'c', 's', and 'u' attributes are not honored by the ext2, ext3, and ext4 file systems as implemented in the current mainline Linux kernels. Setting 'a' and ...
  4. [4]
    chflags(1)
    ### Summary of chflags(1) Man Page
  5. [5]
    [PDF] a brief history of the BSD Fast File System | USENIX
    May 27, 2007 · I wrote the Fast File System, now called UFS, in the early 1980s. In this article, I have written a survey of the work that I and others have ...
  6. [6]
    e2fsprogs definition - The Linux Information Project
    May 31, 2004 · Introduced in January 1993, ext2 was a rewrite of ext, the first Linux native filesystem. ... chattr: changes the attributes of files on an ext2 ...
  7. [7]
    The Second Extended Filesystem - The Linux Kernel documentation
    These flags can be listed with lsattr and changed with the chattr command, and allow specific filesystem behaviour on a per-file basis. There are flags for ...
  8. [8]
    Common Linux features - BTRFS documentation!
    The btrfs filesystem supports setting file attributes or flags. Note there ... (chattr(1) support added in 1.46.2). When set on a directory, all newly ...
  9. [9]
    chattr and lsattr commands in Linux with examples - GeeksforGeeks
    Jul 11, 2025 · The 'chattr' (change attribute) command is a file system utility in Linux that allows users to change the attributes of files and directories.
  10. [10]
    chflags(2)
    ### Summary of Filesystem Support for chflags in FreeBSD (UFS and ZFS)
  11. [11]
    "chflags uunlink foo" on FreeBSD fails with EOPNOSUPP ... - GitHub
    Nov 25, 2024 · chflags sunlink foo works, but chflags uunlink foo does not. Example: % chflags uunlink foo chflags: foo: Operation not supported % chflags ...Missing: partial uappend schg
  12. [12]
    Solved - ZFS equivalent of uchg flag? - The FreeBSD Forums
    Aug 1, 2012 · The allow.chflags setting does exactly what I was looking for: now a privileged user change set flags even in a jail, run on top of ZFS.
  13. [13]
    chflags Man Page - macOS - SS64.com
    Putting the letters no before an option causes the flag to be turned off. For example: uchg Means the file cannot be changed nouchg Means the file can be ...Missing: APFS | Show results with:APFS
  14. [14]
    What exactly is chflags opaque, nodump? - Apple Stack Exchange
    Mar 20, 2021 · The opaque flag has no meaning with respect to union mounts, because all files and directories are already opaque.Missing: APFS support uchg
  15. [15]
    DragonFly On-Line Manual Pages : hammer2(8)
    The hammer2 utility provides miscellaneous support functions for a HAMMER2 file system. ... Thus it is possible to chflags and remove files and directories ...
  16. [16]
    File flag defaults on ZFS | The FreeBSD Forums
    Sep 22, 2020 · ZFS sets the uarch flag following any change to the file, UFS doesn't. The NFS mount likely doesn't support flags at all.
  17. [17]
    [PDF] 967-malone.pdf - USENIX
    Note that file flags can only be manipulated locally and cannot be set or cleared over NFS. This means that marking a file on an NFS server as immutable is a.
  18. [18]
    chflags in jail · Issue #1474 · freebsd/pkg - GitHub
    Sep 22, 2016 · Note that it's still possible to use chflags in jail if allow.chflags parameter for this jail is set.
  19. [19]
    chattr(1): change file attribs on file system - Linux man page
    Description. chattr changes the file attributes on a Linux file system. The format of a symbolic mode is +-=[acdeijstuADST].Description · Options · Attributes<|control11|><|separator|>
  20. [20]
    capabilities(7) - Linux manual page - man7.org
    CAP_FOWNER • Bypass permission checks on operations that normally require ... 24, only the first two of these requirements are met; since Linux 2.6.24, all ...
  21. [21]
    lsattr(1) - Linux manual page - man7.org
    lsattr lists the file attributes on an ext2/ext3/ext4 file system. See chattr(1) for a description of the attributes and what they mean.
  22. [22]
  23. [23]
    chflags(1) - OpenBSD manual pages
    HISTORY. The chflags command first appeared in 4.4BSD. September 2, 2019 OpenBSD- ...
  24. [24]
    chflags(2)
    ### Privileges for chflags System Call
  25. [25]
    chflags(2) - OpenBSD manual pages
    The chflagsat () function first appeared in FreeBSD 10.0. It was added to OpenBSD in OpenBSD 5.7. August 4, 2022 OpenBSD-current.
  26. [26]
  27. [27]
    ls(1) - OpenBSD manual pages
    DESCRIPTION. For each operand that names a file of a type other than directory, ls displays its name as well as any requested, associated information.
  28. [28]
  29. [29]
    stat(1) - NetBSD Manual Pages
    The stat utility displays information about each file given by file. ... f User defined flags for file (st_flags). v Inode generation number (st_gen) ...
  30. [30]
  31. [31]
  32. [32]
  33. [33]
    File Directory Flags in macOS - MCSI Library
    We will utilise chflags command to set the flag hidden on the directory. ... This flag is also referred to with the names uchg and uchange, which is why ...
  34. [34]
    securelevel - FreeBSD Manual Pages
    Once you have set the security level to 1, write access to raw devices will be denied and special chflags(1) flags, such as schg, will be enforced. You must ...