An example of a program that has the SUID bit set is "passwd". This allows a user to change their own password, which is stored in a file that is only writable by root.
The sticky bit is set on world writable directories. It prevents a user from deleting a file that they don't own.
The directory itself is a file, and since the directory is world writable, a user would otherwise be able to delete the file. An example is the /tmp directory.
ls /tmp -l -d
drwxrwxrwt 31 root root 1200 2006-03-23 04:37 /tmp
SGID programs will make your effective gid the same as the program. It is more usefull in a multiuser environment to allow access to files by all members of a group.
Last edited by jschiwal; 03-23-2006 at 04:53 AM.