LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 102Reputation: 102

Quote:
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.
 
  


Reply


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 10:01 PM
how to copy images recursively via bash mindfriction Programming 6 12-13-2007 10:25 PM
Using cp to copy directory permissions recursively? SirTristan Linux - Newbie 3 11-25-2007 08:36 AM
trying to recursively copy jpegs DJOtaku Linux - General 10 08-26-2005 01:09 PM
recursively copy php.ini to www directories osio Programming 3 07-01-2005 04:24 AM


All times are GMT -5. The time now is 09:22 AM.

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