t is called the sticky bit and indicates that in this directory, files can only be deleted by their owners, the owner of the directory or the root superuser. it is not enough for a user to have write permission on /tmp, he also needs to be the owner of the file to be able to delete it.

In order to set or to remove the sticky bit,

chmod +t tmp
chmod -t tmp

SGID attribute on a directory

chmod g+s directory
chmod g-s directory

Setting SUID and SGID attributes on executable files

chmod g+s myscript.sh
chmod g-s myscript.sh

chmod u+s myscript.sh
chmod u-s myscript.sh

Setting the default file creation permissions

The default umask value is usually 022.

umask 022

By default umask is 000, files get mode 666 and directories get mode 777. As a result, with a default umask value of 022, newly created files get a default mode 644 (666 - 022 = 644) and directories get a default mode 755 (777 - 022 = 755).