What is wild card to select all directories in a directory

directorywildcards

i want to set sticky bit for all directories in a directory excluding files. is there any wild card to do this?

#sudo chmod g+s /var/www/<WILD_CARD_FOR_ALL_DIRECTORIES>

Best Answer

Use */ to match only directories.

chmod g+s /var/www/*/

To match all directories and subdirectories use **/*/ (provided you have globstar enabled in bash):

shopt -s globstar
chmod g+s /var/www/**/*/