The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find, make and move file based on username Helmi UNIX for Dummies Questions & Answers 5 04-19-2007 10:49 PM
how to start a process and make it sleep for 5 mins and then kill that process shrao Shell Programming and Scripting 6 03-27-2007 01:54 PM
how to find the chid process id from given parent process id guhas Shell Programming and Scripting 3 10-13-2005 09:13 AM
How would I make a find command NOT show the path of a file? LordJezo Shell Programming and Scripting 1 10-01-2004 07:01 AM
how to make a current running process ignore SIGHUP signal? stevensxiao UNIX for Advanced & Expert Users 3 12-02-2003 01:35 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-01-2006
tphyahoo tphyahoo is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 24
Is there a way to make this find job run as one process, more efficiently?

Hi, unixers, I'm doing something like

find -type f -name '*.gif' | xargs rm &
find -type f -user root | xargs chown idealo &
wait
#do more stuff

on a very large dir. I'm thinking this would be more efficient if it was running as a single process that did one thing for the first condition, another thing for the other condition. I could do this with perl (File::Find), but I'm wondering if there's an elegant solution with bash.

thanks for any insight!
  #2 (permalink)  
Old 06-01-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,800
You might be wrong in your thinking.

By creating two sub-proceses you are probably making the overall time of the job shorter. This is because both of those commands will spend time wating on disk i/o's to complete. When one process is waiting for i/o completion the other one can run.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:36 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0