File permissions "T" are sticky bits

When I created a file with Chef, I made a typo as 644 instead of 0644 in mode. The file permissions are as follows.

--w----r-T   1 root root

What is this T? I thought, so I looked it up.

Sticky bit

T is called a sticky bit and seems to have the following characteristics.

The most common use for sticky bits is for directories,
When set, the file name of the file under the directory can be changed or deleted.
Only the owner of the file, the owner of the directory, or the superuser can do it.

[Sticky Bit](https://en.wikipedia.org/wiki/%E3%82%B9%E3%83%86%E3%82%A3%E3%83%83%E3%82%AD%E3% 83% BC% E3% 83% 93% E3% 83% 83% E3% 83% 88)

How to set the sticky bit

Then, how to set the sticky bit, but it seems that it can be set by the following method.

chmod 1777 hoge

UNIX room command search: chmod (* BSD / Linux)

Recommended Posts

File permissions "T" are sticky bits
Linux file and directory permissions