STICKY(7)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1, nixpkgs unstable

πŸŽ€ STICKY(7) πŸŽ€

okay so bestie, welcome to the sticky(7) page from the Miscellaneous Information Manual. it's literally all about the sticky bit and append-only directories, and it's giving permissions lore. no cap. πŸ’…

✨ NAME ✨

sticky β€” sticky text and append-only directories

🌸 DESCRIPTION 🌸

There's a special file mode called the sticky bit (mode S_ISTXT) that's used to indicate special treatment for directories. For regular files? It's ignored. literally ignored, bestie. πŸ™ˆ For the whole explanation of file modes, see chmod(2) or the file <sys/stat.h>.

πŸ”₯ STICKY DIRECTORIES πŸ”₯

When a directory has its sticky bit set, it becomes an append-only directory β€” or, more accurately, a directory in which the deletion of files is restricted. The way that works: a file in a sticky directory may only be removed or renamed by a user if both things are true:

  • the user has write permission for the directory, and
  • the user is the owner of the file, the owner of the directory, or the super-user.

This feature is usefully applied to directories such as /tmp, which must be publicly writable but should deny users the license to arbitrarily delete or rename each others' files. 🫢

Any user may create a sticky directory. For details about modifying file modes, see chmod(1). ✨

πŸ¦‹ HISTORY πŸ¦‹

A sticky command appeared in Version 7 AT&T UNIX/32V. history icon behavior, honestly. πŸ‘‘

πŸ’€ BUGS πŸ’€

Neither open(2) nor mkdir(2) will create a file with the sticky bit set. not me finding that out the hard way 😭


mwah πŸ’‹ this little page is from Debian, dated June 5, 1993. bye bestie, go set some modes responsibly 🫢

πŸ“¦ where this page comes from