long string using find and "-exec ls -ls" to find part-of filename
Polytropon
freebsd at edvax.de
Mon Jun 30 22:22:46 UTC 2014
On Mon, 30 Jun 2014 11:45:06 -1000, Parv wrote:
> in message <20140630230316.44ec3257.freebsd at edvax.de>,
> wrote Polytropon thusly...
> >
> > On Sun, 29 Jun 2014 23:40:44 -0700, Gary Kline wrote:
> > > ANYWAY, the thing learned tonight is that it's *XARGS* <cmd>
> > > instead of -exec abcfubarCmd.
> >
> > Allow me to add one little reminder:
> >
> > When using xargs, usually _one_ program will be executed
> > with a command line containing _all_ results of the find
> > command. If you want to run a program on _each_ of the
> > results, this is the typical sh solution:
> >
> > find ... | while read F; do
> > somecommand $F
> > done
> ...
>
> If only one command to be run for each file, then xargs can be used
> with "-n" option to specify "the maximum number of arguments taken
> from standard input for each invocation" ...
>
> find ... | xargs -n 1 command ...
This works! After reading "man xargs" I have re-instantiated
my memory about this feature. Thanks for the reminder! :-)
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions
mailing list