Sticky bit

In computing, the sticky bit is a user ownership access right flag that can be assigned to files and directories on Unix-like systems.

For files, particularly executables, superuser could tag these as to be retained in main memory, even when their need ends, to minimize swapping that would occur when another need arises, and the file now has to be reloaded from relatively slow secondary memory.

Files in a shared directory such as /tmp belong to individual owners, and non-owners may not delete, overwrite or rename them.

[2] When set, it instructed the operating system to retain the text segment of the program in swap space after the process exited.

This speeds up subsequent executions by allowing the kernel to make a single operation of moving the program from swap to real memory.

[clarification needed] The most common modern use of the sticky bit is on directories residing within filesystems for Unix-like operating systems.

[citation needed] The sticky bit is also set by the automounter to indicate that a file has not been mounted yet.