[NTLUG:Discuss] Bash command

David D. Scribner dscribner at nichedev.com
Fri Jul 23 21:23:39 CDT 2004


Dennis [dearroz at comcast.net] wrote:
> I am attempting to create a dual command to delete files, such that I 
> search for files greater than n days (find -atime +n) and then deleting 
> them (rm -f).  I have attempted several alternatives of the command, but 
> not working.
> 
> I have tried :
>    rm -f < $(find -atime +5)
>    find -atime +5 | $(rm -f)
> and a few other variations.  Know the solution is obvious to the 
> knowledgeable.
> 
> Suggestions please.
> 
> Dennis Rice
> dennis at dearroz.net

try:

  $find -atime +5 | xargs rm

-- 
David D. Scribner
dscribner at bigfoot.com     http://www.bigfoot.com/~dscribner/
GnuPG/PGP: 3172 7408 58CA D9C2 F697  950F 9DDC 7AC7 91EC 5F06
 
My software never has bugs. It just develops random features!
 



More information about the Discuss mailing list