Linux sticky bit and stickybit
Only the root or owner can delete or rename the file when setting the stick position.
Example:
The default apple group is fruit.
[Root @ titan ~] # Id apple
Uid = 1001 (apple) gid = 1001 (fruit) group = 1001 (fruit)
Step 1 shows the water Folder Information, which is not currently set with a sticking bit.
[Root @ titan/] # ls-l | grep water
Drwxr-xrwx. 4 root 4096 August 10 21:02 water
Step 2 shows the water subfolders.
[Root @ titan/] # ls-l water
Total usage 8
Drwxr-xr-x. 2 root 4096 August 10 21:02 mineral
Drwxr-xr-x. 2 root 4096 August 10 21:02 pure
Step 3 Delete the mineral folder.
[Apple @ titan water] $ rm-r mineral/
Rm: Do you want to delete the write-protected directory 'Mineral /'? Y
Step 4: display the water subfolders.
[Apple @ titan water] $ ls-l
Total usage 4
Drwxr-xr-x. 2 root 4096 August 10 21:02 pure
Step 5 set the adhesion bit for the water folder.
[Root @ titan/] # chmod o + t water
[Root @ titan/] # ls-l | grep water
Drwxr-xrwt. 3 root 4096 August 10 21:08 water
Step 6 Delete the pure folder as an apple user.
[Apple @ titan water] $ rm-r pure
Rm: Do you want to delete the write-protected directory 'pure '? Y
Rm: Unable to delete 'pure ': Operation not permitted
Step 7 delete the pure folder as the root user.
[Root @ titan water] # rm-r pure/
Rm: Do you want to delete the 'ure/'directory /'? Y
Step 8 shows the water subfolders.
[Root @ titan water] # ls-l
Total usage 0