Monday, February 9, 2015

Linux file-folder permission sticky bit

In UNIX like systems there are special permissions for folders and files. Sticky bit is one of the special permission.

The sticky bit is a user ownership access right flag that can be assigned to files and directories on Unix-like systems.

When a directory's sticky bit is set, the file system treats the files in such directories in a special way so only the file's owner, the directory's owner, or root user can rename or delete the file.

The sticky bit can be set using the chmod command and can be set using its octal mode 1000 or by its symbol t.

For example, to add the sticky bit on the directory /test one can type chmod +t /test
To clear it, use chmod -t /test


If the sticky-bit is set on a file or directory which doesn't have execution permission to others, it is indicated with a capital T