CHFLAGS(1)
π
CHFLAGS(1) β the chflags glow-up (General Commands Manual)
okay so bestie, welcome to chflags β the little utility that changes the file flags of your files, fr fr. like, you hand it a flags operand and a list of file ... and it just goes and does the thing. slay β¨
β¨ SYNOPSIS β¨
chflags [-fhvx] [-R [-H | -L | -P]] flags file ...
π¦ DESCRIPTION π¦
The chflags utility modifies the file flags of the listed files as specified by the flags operand. that's it, that's the whole vibe π
The options are as follows β buckle up, there's a bunch:
-fβ do not display a diagnostic message ifchflagscould not modify the flags for file, and do not modify the exit status to reflect such failures. like, it just moves on, no drama π-Hβ if the-Roption is specified, symbolic links on the command line are followed and hence unaffected by the command. (symbolic links encountered during traversal are not followed.) iykyk π-hβ if the file is a symbolic link, change the file flags of the link itself rather than the file to which it points. main character energy for the link π-Lβ if the-Roption is specified, all symbolic links are followed. all of them. periodt β¨-Pβ if the-Roption is specified, no symbolic links are followed. this is the default. lowkey the chill one πΈ-Rβ change the file flags of the file hierarchies rooted in the files, instead of just the files themselves. beware of unintentionally matching theβ..βhard link to the parent directory when using wildcards likeβ.*β. π«Ά this one will vibe-check you back, ngl-vβ causechflagsto be verbose, showing filenames as the flags are modified. if the-voption is specified more than once, the old and new flags of the file will also be printed, in octal notation. double-v= extra detail, we love to see it π₯-xβ do not cross mount points. stay in your lane, bestie π§
π§ the flags themselves (the fun part) π§
The flags are specified as an octal number or a comma separated list of keywords. the following keywords are currently defined:
arch,archivedβ set the archived flag (super-user only) πnodumpβ set the nodump flag (owner or super-user only)opaqueβ set the opaque flag (owner or super-user only) [directory is opaque when viewed through a union mount]sappnd,sappendβ set the system append-only flag (super-user only) πschg,schange,simmutableβ set the system immutable flag (super-user only) πuappnd,uappendβ set the user append-only flag (owner or super-user only)uchg,uchange,uimmutableβ set the user immutable flag (owner or super-user only)hiddenβ set the hidden flag [hide item from GUI] π«£
π the "no" trick π
Putting the letters βnoβ before a keyword β or removing the letters βnoβ from a keyword β causes the flag to be cleared. for example:
nouchgβ clear the user immutable flag (owner or super-user only)dumpβ clear the nodump flag (owner or super-user only)
literally the same word, opposite vibes. π
β οΈ important caveats, pls read β οΈ
Unless the -H or -L options are given, chflags on a symbolic link always succeeds and has no effect. π like, it does nothing but it's not a fail. iconic but useless.
The -H, -L and -P options are ignored unless the -R option is specified. also, these options override each other and the command's actions are determined by the last one specified. so the last one wins, always β no tiebreakers π
You can use "ls -lO" to see the flags of existing files. β
If chflags receives a SIGINFO signal (see the status argument for stty(1)), then the current filename as well as the old and new flags are displayed. cute lil progress update π¦
πΈ EXIT STATUS πΈ
The chflags utility exits 0 on success, and >0 if an error occurs. simple as that π«Ά
β¨ EXAMPLES β¨
Recursively clear all flags on files and directories contained within the foobar directory hierarchy:
chflags -R 0 foobar
the 0 is doing so much work here and nobody's talking about it π
π SEE ALSO π
ls(1), chflags(2), stat(2), fts(3), symlink(7)
go read them, bestie, they're all part of the lore π
π¦ HISTORY π¦
The chflags command first appeared in 4.4BSD. an icon, a legend, a pioneer π
π BUGS π
Only a limited number of utilities are chflags aware. some of these tools include ls(1), cp(1), find(1), install(1), dump(8), and restore(8). in particular, a tool which is not currently chflags aware is the pax(1) utility. π so if pax ignores your flags, that's not you, that's pax.
okay that's the whole page, bestie β this manual page came to you from Debian, dated June 12, 2018. go forth and flag responsibly π«Άβ¨π
π¦ where this page comes from
- nixpkgs unstable: file_cmds 479
- Copyright (c) 1989, 1990, 1993, 1994 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms