STICKY(8)
π NAME π
okay so this is the sticky(8) page from the System Manager's Manual, and it's all about sticky text and append-only directories, bestie. slay.
β¨ DESCRIPTION β¨
There's a special file mode called the sticky bit (mode S_ISVTX), and it tells the system to give files and directories some special treatment. For the full tea on file modes, see chmod(2) or the file /usr/include/sys/stat.h.
π STICKY FILES π
Historically, if an executable shareable file had the sticky bit set, it was not immediately discarded from swap space after execution. The kernel hoarded the text segment of the file for future reuse, which avoided having to reload the program. iconic behavior, honestly.
But no cap: this is no longer true on modern systems. The current virtual memory system keeps track of recently used executables, which makes the sticky bit for files redundant. The sticky bit can still be set on files, but it has without any effect β literally no effect. π
Only the superuser can set the sticky bit on a file, though the owner of the file may clear the sticky bit.
π STICKY DIRECTORIES π
A directory with the βsticky bitβ set places restrictions on file deletion. Here's the vibe check:
- A file in a sticky directory may only be removed or renamed by a user if the user has write permission for the directory and the user is the owner of the file, the owner of the directory, or the superuser.
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. main character directory energy, fr fr.
Any user may create a sticky directory. See chmod(1) for details about modifying file modes.
π HISTORY π
A sticky command appeared in Version 7 AT&T UNIX/32V. history queen π
π BUGS π
Neitheropen(2)normkdir(2)will create a file with the sticky bit set. rude, but okay.
mwah π β this page is from Debian, dated May 24, 2023. π«Ά
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 1980, 1991, 1993 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