Useful Linux Command
Monday, February 28th, 2005Today I was searching for a good way to change permissions recursively, but only on directories or only on files, because of the vast difference in meaning for the executable flag between the two. Google is a great friend, and led me to a site, whose address I do not exactly remember, but whose advice was perfect:
find . -type d -name public_html -exec chmod 0755 {} \;
Just strip out the -name argument, and change between -type d and -type f to chmod only files or only directories, recursively from the current directory. A great way to correct past misconceptions about the setgid and setuid bits!