Only root or owner can delete and rename files when the sticky bit is set.
Example:
The user Apple Default group is fruit.
[[email protected] ~]# ID apple
uid=1001 (apple) gid=1001 (fruit) group =1001 (fruit)
STEP1 Displays the Water folder information, the folder is not currently set to a sticky position .
[Email protected]/]# Ls-l | grep water
Drwxr-xrwx. 4 root root 4096 August 21:02 water
STEP2 Displays water subfolder information.
[Email protected]/]# ls-l water
Total Dosage 8
Drwxr-xr-x. 2 root root 4096 August 21:02 mineral
Drwxr-xr-x. 2 root root 4096 August 21:02 Pure
Step3 Delete the mineral folder.
[Email protected] water]$ rm-r mineral/
RM: Do you want to delete the write-protected directory ' mineral/'? Y
STEP4 Displays water subfolder information.
[Email protected] water]$ ls-l
Total Dosage 4
Drwxr-xr-x. 2 root root 4096 August 21:02 Pure
Step5 the Water folder with a sticky bit .
[Email protected]/]# chmod o+t Water
[Email protected]/]# Ls-l | grep water
DRWXR-XRWT. 3 root root 4096 August 21:08 water
STEP6 Delete the Pure folder with Apple users .
[Email protected] water]$ Rm-r Pure
RM: Do you want to delete the write-protected directory ' pure '? Y
RM: Cannot delete ' pure ': Operation not permitted
STEP7 Delete the Pure folder as the root user .
[Email protected] water]# rm-r pure/
RM: Do you want to delete the directory ' pure/'? Y
STEP8 Displays water subfolder information.
[Email protected] water]# ls-l
Total dosage 0
Linux sticky bit (sticky bit)