Using find to open all files in subdirectories -


could please me find syntax. i'm trying replicate effect of command, opens files in each of specified subdirectories:

open mockups/dashboard/* mockups/widget/singleproduct/* mockups/widget/carousel/* 

i'd make work set of subdirectories below mockups.

i can show subdirectories with:

find mockups -type d -print 

but i'm not sure how use xargs add in "*". also, don't want separately execute open each file "-exec open {} \;", because launches 50 different copies of preview, when need 1 instance of preview 50 files loaded it.

thanks!

the version of find have @ hand allows specify + sign after -exec argument:

from man page:

-exec command {} +               variant of -exec action runs specified command on                selected files, command line built appending each                selected file name @ end; total number of invocations of                command less number of matched files.                 command line built in same way xargs builds                command lines.  1 instance of `{}' allowed within                command.  command executed in starting directory. 

that means few instances of open executed possible, e.g.:

find mockups -type f -exec open {} + 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -