To find all world-writable directories that have the sticky bit set in a Linux or UNIX system, you can use the find
command with the -perm
and -type
options.
For example, the following command will find all directories that have world-writable permissions (222
) and have the sticky bit set (01000
):
find /path/to/search -type d -perm -1777
The -type d
option specifies that only directories should be searched, and the -perm -1777
option searches for files with any of the specified permissions (in this case, world-writable permissions and the sticky bit).
To search for world-writable directories that do not have the sticky bit set, you can use the !
operator to negate the search:
find /path/to/search -type d ! -perm -1777
This will find all world-writable directories that do not have the sticky bit set.
For more information on the find
command and its options, you can refer to the documentation or use the man
command to view the manual pages.