Skip to content

What is the Sticky Bit?

What is it?

The sticky bit is a permission that is used on files to protect them by only allowing the owner of the file, the owner of the directory, and a privileged user to be able to delete the file. It is called "the sticky bit" because when it used on a directory, users can create files but not delete them, making it "sticky." This makes it useful to protect directories that are shared.

History of the Sticky Bit

The sticky bit was originally used to cache programs in memory. However, the memory management algorithims of operating systems got more advanced which made this obselete. Modern Linux even ignores the sticky bit on files.

Setting the Sticky Bit

To set the sticky bit on a file or directory, the following command can be ran

console
chmod +t path/to/file/or/dir