Find

From Kb

Jump to: navigation, search

Look for and change permission of only directories:

find . -type d -exec chmod 755 {} \;
find . -type d -exec chmod a+x {} \;

Look for and change permission of only files:

find . -type f -exec chmod 644 {} \;
find ./ -name *.pdf -exec chmod 755 {} \;
find . -type d -user fileowner -exec chmod 0755 {} \;
find . -type f -name '*.htm*' -exec chmod 644 {} \;
Remove all SVN directories
find . -name ".svn" -type d -exec rm -rf {} \;


Example Source

Look for the string "com.apple.itunes" in files that end with ".plist":

sudo find / -name *.plist -exec grep -l 'com.apple.itunes' {} \;
Personal tools