Pipes and commands that require two arguments

Dan Nelson dnelson at allantgroup.com
Thu Apr 8 09:55:25 PDT 2004


In the last episode (Apr 08), Peter Risdon said:
> I'm stuck with this, so hope nobody will mind the fact that is isn't
> strictly a FreeBSD question.
> 
> I want to redirect the output of a command to mv(1) as the source
> file, and specify somehow a destination directory. Basically, I have
> to move several thousand files whose names match a number of patterns
> to a single directory.

The xargs manpage has an example that should get you on the right
track:

    /bin/ls -1d [A-Z]* | xargs -J % cp -rp % destdir

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list