exclude directory using find

find -name "*.js" -not -path "./directory/*"

#example
find . -name "*.py" -not -path "./anaconda2/*"


# copy the files find to a directory
find -name "*.js" -not -path "./directory/*" -exec cp {} temp/ \;

find . -name "*.py" -not -path "./anaconda2/*" -exec cp {} pycoll/ \; 

 

Leave a Reply

Your email address will not be published.

Notice: Undefined index: cookies in /var/www/html/wp-content/plugins/live-composer-page-builder/modules/tp-comments-form/module.php on line 1638