Using the sticky bit on a directory to control file access

Using the mkdir, MKDIR, or chmod command, you can set the sticky bit on a directory to control permission to remove or rename files or subdirectories in the directory. When the bit is set, a user can remove or rename a file or remove a subdirectory only if one of these is true:
  • The user owns the file or subdirectory.
  • The user owns the directory.
  • The user has superuser authority.

If you use the rmdir, rename, rm, or mv utility to work with a file, and you receive a message that you are attempting an operation not permitted, check to see if the sticky bit is set for the directory the file resides in.