Categories
Code Tutorials Work

How to tar a directory and only include certain file types

find myProjectDirectory -type f \( -name \*\.php -o -name \*\.js -o -name \*\.css -o -name \*\.inc \) | xargs tar -rf myProjectTarName.tar
Categories
Code Tutorials Work

How to change file or folder permissions recursively with chmod

To set only files that end with .tpl to 600 (pattern escaped with slashes)

find . -name \*\.tpl -exec chmod 600 {} \;