CHOWN(1B)
β¨ CHOWN(1B) β¨
Hey bestie, welcome to the CHOWN(1B) glow-up π β¨ β yes, it's the BSD System Compatibility version, and yes, we're gonna get into it.
πΈ NAME πΈ
chown β (BSD) change file ownwer π (ok so the original literally spells it "ownwer" and I'm not fixing it because DETAILS, but just know it's giving "owner" energy, fr fr)
π SYNOPSIS π
/ucb/chown [-fhHLPR] owner[.group] file ...
π DESCRIPTION π
Okay so picture this: chown changes the owner of the files to owner, and if group is also there? It changes the group-ID of the files to group. Slay. π«Ά
And here's the tea: both owner and group can be either a decimal UID / GID or a login / group name that's found in the password file. iykyk.
The following options are accepted:
-fβ bestie said "no negativity" β do not display errors π-hβ when a symbolic link is encountered, change the owner and group of the link itself, not the file it refers to. main character energy, focusing on the link not the destination π-Rβ recursively descend into each file operand. Whether owner and group of a symbolic link are changed depends on the-hoption, but the link is not followed otherwise. it's giving "respect the link's boundaries" β¨
π The POSIX.1-2001 options (yes they're iconic, no we're not skipping them) π
-Hβ with the-Roption, if a symbolic link given on the command line points to a directory, follow that symbolic link and change owner and group in the files below, but do not handle any other symbolic links specially. so like, only the command-line link gets the special treatment, periodt. π-Lβ with the-Roption, whenever a symbolic link is encountered that points to a directory, follow the symbolic link and change owner and group in the files below. it's giving "follow every directory link you see" energy π₯-Pβ with the-Roption, do not follow any symbolic links, but change owner and group of the links themselves. no chasing, just respecting the link as-is, ngl that's valid π¦
π FILES π
/etc/passwd/etc/group
these are the files, bestie β the sources of truth for all your user and group name needs π
β SEE ALSO β
go read those if you wanna go deeper, iykyk πΈ
π NOTES π
Okay so permission to change owner and group? It's based on either:
- historical System V behaviour β which is to allow the owner of the file or a privileged user to change to any value (wild, I know π), or
- historical BSD behaviour β which is to restrict changing the owner to a privileged user and changing the group to a group to which the file owner belongs (more chill, more rules, still iconic)
so yeah, it depends on the vibe of your system, fr fr. π
π That's the whole page, bestie. No cap, every option, file, and note is here. Go change some owners and slay. β¨
This page is brought to you by the Heirloom Toolchest, dated 1/29/05 β vintage but still iconic ππ
π¦ where this page comes from
- nixos 26.05: heirloom 070715
- nixpkgs unstable: heirloom 070715
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms