Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-11-2009, 06:36 PM   #46
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102

Originally Posted by i92guboj View Post
There are lots of ways of doing it, however this way has the problem of efficiency. As I said before, you will be running one mv or cp command for each file, which is far from efficient. It all depends on the number of files of course. xargs solves that.

Besides that, what's the point of egrep? The find -iname option does the same, doesn't it? No need for an extra pipe which bogs the system resources even more and creates yet more i/o.

It's a matter of correctly passing and quoting everything. This solution is not special in that regard.
I offered it because the original thread got bogged down in trying to explain how "find" and "xargs" work together (for a relative newbie). "xargs" in particular is rather tricky in this regard.

The method I posted is easier to understand, and it's more appropriate to placing in a script than is the "xargs" approach.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
copy recursively across directories stefaandk *BSD 1 11-09-2008 11:01 PM
how to copy images recursively via bash mindfriction Programming 6 12-13-2007 11:25 PM
Using cp to copy directory permissions recursively? SirTristan Linux - Newbie 3 11-25-2007 09:36 AM
trying to recursively copy jpegs DJOtaku Linux - General 10 08-26-2005 02:09 PM
recursively copy php.ini to www directories osio Programming 3 07-01-2005 05:24 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:56 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration