Skip to content
ENExplore Calculators

Sticky Bit Calculator

Calculate the resulting permission bits of setting the sticky bit on shared directories.

About Sticky Bit Calculator

The sticky bit, 1000 in octal special-permissions notation, restricts file deletion within a directory: even if a directory is world-writable (allowing any user to create files in it), only a file's owner or root can delete or rename that specific file when the sticky bit is set — without it, anyone with write access to the directory could delete or rename any file inside regardless of who created it. This is exactly why /tmp and /var/tmp ship with mode 1777 (world-writable plus sticky) by default: every user needs to be able to create temporary files there, but users must not be able to tamper with or delete each other's temp files.

Formula

Sticky bit in octal notation

1000 = sticky bit; full mode = 1000 + owner/group/other permission bits (e.g. 1777)

Worked example

With the default values below, Sticky Bit Calculator returns Sticky Bit Assessment of Sticky bit is SET on a world-writable directory (/tmp) — the safe, intended pattern. Any user can create files here, but only the file's owner (or root) can delete or rename it, preventing users from deleting each other's files.. Change any input above and every figure here is recalculated in your browser.

Inputs used

Full Octal Mode (e.g. 1777)accepts 0–7,777
1,777
Directory Description (optional, e.g. /tmp)
/tmp

Results

Sticky Bit Assessment
Sticky bit is SET on a world-writable directory (/tmp) — the safe, intended pattern. Any user can create files here, but only the file's owner (or root) can delete or rename it, preventing users from deleting each other's files.
Risk Level
Low
Sticky Bit Set?
true
World-Writable?
true

Step by step

  1. 1Values used
  2. 2Sticky bit in octal notation
  3. 3Sticky Bit Assessment= Sticky bit is SET on a world-writable directory (/tmp) — the safe, intended pattern. Any user can create files here, but only the file's owner (or root) can delete or rename it, preventing users from deleting each other's files.
  4. 4Risk Level= Low
  5. 5Sticky Bit Set?= Yes
  6. 6World-Writable?= Yes

Assumptions and limits

  • The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

How do I set the sticky bit on a directory?

`chmod +t /path/to/dir` sets it (equivalently `chmod 1777 /path/to/dir` for a fully world-writable directory with sticky protection); `chmod -t /path/to/dir` removes it. A sticky directory typically displays a trailing 't' (or 'T' if not executable/searchable) in `ls -ld` output.

How do I find all world-writable directories missing the sticky bit?

`find / -xdev -type d -perm -0002 ! -perm -1000 2>/dev/null` finds world-writable directories where the sticky bit is NOT set — a common security audit check, since such directories allow any user to delete or rename files owned by other users.

Does the sticky bit do anything on a regular file?

On modern Linux, setting the sticky bit on a regular (non-directory) file has no effect — historically on some older Unix systems it hinted to the kernel to keep the program's text segment in swap for faster reloading, but this legacy 'saved text' behavior is obsolete on Linux.

Sticky Bit Calculator | Calcrivo