Monday, 8 August 2011

UNIX find command to fine multiple extension files



Find multiple extensions with unix 'find' command

practical use, while putting files in svn we may have to find static files and exclude from svn, specially when these static files are scatter in almost all the folders in every corner.

find . -type f \( -iname "*.gif" -o -iname "*.png" -o -iname "*.jpg" -o -iname "*.ppt" -o -iname "*.tar" -o -iname "*.mp3" -o -iname "*.doc" -o -iname "*.zip" \) | xargs tar -zcvf /home/mazmath/features.static.tar.gz

No comments:

Post a Comment