Sticky bit
The sticky bit is a Unix permission flag with two historical meanings. For files, it once told the system to keep a program’s code in memory after it finished, to speed up later runs. That usage is now obsolete on Linux and most modern systems. For directories, the sticky bit is the important modern meaning.
When a directory has the sticky bit set, only the file’s owner, the directory’s owner, or root can rename or delete files inside that directory. Without the sticky bit, any user who can write and execute in the directory can rename or delete files, regardless of who owns them. This is why /tmp often has the sticky bit set: it lets anyone create files but prevents users from deleting or moving others’ files.
How to set and clear
- Add the sticky bit on a directory: chmod +t /path/to/dir
- A common safe setting is: chmod 1777 /path/to/dir (world-writable with sticky bit)
- Remove the sticky bit: chmod -t /path/to/dir
- Or reset to standard permissions: chmod 0777 /path/to/dir
In ls output, the sticky bit is shown in the final permissions character as t or T. It appears as t when others have execute permission; as T when others do not.
Notes
- The old, file-related use of the sticky bit is largely unused today.
- The sticky bit is typically set by the superuser; the owner can usually clear it.
This page was last edited on 3 February 2026, at 09:28 (CET).