[svlug] Re: [svlug]how to copy a bunch of "." files?

Jean-Marc Libs libs at cybercable.tm.fr
Wed May 3 11:20:45 PDT 2000


On Thu, 27 Apr 2000, Francis Pinteric wrote:

> On 27-Apr-2000 Ian B MacLure wrote:
> >>
> >>find . -type f -maxdepth 1 | xargs -i mv '{}' otherdir
> 
> Here's a question that I seen a lot of and I' wondering what the advantage is.
> 
> When using find, I see a lot of people using xargs when most of the time it
> isn't necessary. For example, the above find sequence can be written as:
> 
>   find . -type f -maxdepth 1 -exec mv {} otherdir \;
> 
> What advantage does xargs provides in cases like this? Just wondering.

Speed through parallelism, usually.
Try it in a full directory (a newsspool comes to mind :-) )

Obviously, in this specific case, -maxdepth 1 severely restricts
the usefulness of the trick, hence the silly example.

Cheers,
Jean-Marc Libs

-- 
Les Journées du Logiciel Libre les 12 et 13 mai à Strasbourg :
http://strasbourg.linuxfr.org/jl3

                            "I love the way Microsoft follows standards.
            In much the same manner that fish follow migrating caribou."
                                                    -- Paul Tomblin, ASR






More information about the svlug mailing list