The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
Scripts / handy tips
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 Batch commands
Author: k 
Date:   30-01-03 18:03

To speed up commands try batching them.
Instead of the following to delete files older than 30 days in a
script:

#!/usr/local/bin/ksh
find /mypath -type f -mtime +30 -exec rm {} \;
exit $?

Try using a "+" instead of the usual "\;"

Such as:
find /mypath -type f -mtime +30 -exec rm {} +

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 Batch commands   new
k 30-01-03 18:03 
 Re: Batch commands   new
Dan Langille 31-01-03 02:53 
 Re: Batch commands   new
k 31-01-03 04:46 
 Re: Batch commands   new
k 02-02-03 18:09 
 Re: Batch commands   new
Rob Robinson 10-02-04 17:25 
 Re: Batch commands   new
satimis 04-06-04 03:26 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org