whatis sticky-bit

Sticky Bit

A directory permission bit that lets users delete only their own files, even when everyone has write access, as on /tmp.

What Is the Sticky Bit in Linux?

Without the sticky bit, write permission on a directory lets you delete any file in it. With it set, only the file owner, the directory owner, or root can remove or rename entries.

/tmp is the classic example, shown as drwxrwxrwt. Set it with chmod +t dir or the leading octal digit 1, as in chmod 1777.

Example

ls -ld /tmp
# drwxrwxrwt 18 root root 4096 /tmp