permision bits question

Posted on 2003-10-23
Last Modified: 2008-02-01
Hi ,

can someone tell me what is the meaning of the T bit in the permission

i mean


Question by:victorbx
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 18

Assisted Solution

liddler earned 100 total points
ID: 9605511
It's the sticky bit, usually set for /tmp - from chmd(2) man page:

If a directory is writable and has S_ISVTX (the sticky bit) set, files within that directory can be removed or renamed only if one or more of the following is true (see unlink(2) and rename(2) ):
the user owns the file
the user owns the directory
the file is writable by the user
the user is a privileged user

It is to prevent users deleting other users files in a shared / scratch directory like /tmp
LVL 45

Accepted Solution

sunnycoder earned 200 total points
ID: 9605588
Hi victorbx,

liddler is right ... t means sticky bit

When the sticky bit (t) is turned on for a directory users can have read and/or write permissions for that directory, but they can only remove or rename files that they own. The sticky bit on a file tells the operating system that the file will be executed frequently. Files like this are kept in swap space even when they aren't being executed. Although this takes up swap space it greatly reduces the time it takes to execute the program. Programs such as vi have the sticky bit turned on by default.

Once upon a time, Unix didn't have paged virtual memory.  Setting the sticky
bit on an executable caused the kernel to keep the text image in core (make
it `sticky') after a process using it had closed.  This was typically done
on often-used binaries, such as /bin/sh or /bin/vi.

Later on, people noticed a security hole on /tmp: since it has world-write
permission (so that anyone can create temporary files there) it's possible
to delete other people's files.  The solution was to overload the meaning of
the sticky bit for directories: if a directory is sticky, then you can only
delete files in that directory if you own them (or if you're root).

Eventually, when paged virtual memory became standard, kernels ignored the
sticky bit on files, but the name remained for the use of the bit on


Assisted Solution

zafar_ayub earned 200 total points
ID: 9605867

This means only the owner of a file can remove or rename it.
Very handy in shared directories like /tmp.

The chmod man page does not indicate the affect of the "t"/leading
1/stick bit attribute on directories.  I'm told that this prevents
unprivileged users from deleting files that they /do/ have write
access to.  I haven't tested this, but I imagine that it is common

Just to clear up the confusion here.  The 't' bit has an original
meaning for executable programs.  [Keep a copy of the text (which
means code in unix speak) on the swap disk so that it loads faster on
subsequent runs because it can stream the preloaded image from the
swap disk instead of loading from the filesystem disk.  For various
reasons I think this is better to be avoided with modern operating
systems.  It was implemented while UNIX was still extremely primitive.
Much time has passed since then.]  But this did not have a meaning
when applied to directories.  Therefore when a need to create
functionality regarding directories arose they overloaded the 't'ext
bit and gave it a unique meaning when applied to a directory.

On a directory the 't' bit means that if you do not own the file you
cannot delete it.  This is needed on shared, writable directories like
/tmp to prevent one user from deleting another user's files.  Many
programs, like vi as one example, use /tmp for temporary files.
Without the 't' bit anyone could wipe out the entire /tmp directory
and break random programs.  Some of those programs would include
system processes as well.  Therefore shared writable directories
usually require the 't' bit for protection.  It allows you to create
files but prevents you from deleting files created by other users.

Hope this helps

Author Comment

ID: 9606103
Thank you for the greate answers

from all of you



Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question