Sticky Bit

Past

在過去因為 memory 技術不成熟,我們會開啟常用 program (像是 vim, ls, etc)的 sticky bit ,這樣當我們開啟電腦後第一次呼叫它們,kernel 就會將它們備份至 swap,然後因為存在 swap 中的資料大多是連續的,讀取速度就會比較快

Present

現在因為 memory 技術的成熟,對於 file 的 sticky bit 實際上已無太大用處

但當我們打開一個 directory 的 sticky bit,這代表如果我們想要 remove 或 rename 在此 directory 中的 file 的話,除了 write permission ,我們還需滿足下列三個條件之一

  1. owner of the file
  2. owner of the directory
  3. is the superuser

Representation

  • Octal Value: 01000
  • Symbolic: drwxrwxrwt