Re: quickie UNIX command


Subject: Re: quickie UNIX command
From: Hollis Blanchard (hollis@andrew.cmu.edu)
Date: Thu May 17 2001 - 10:53:02 MDT


On Thu, May 17, 2001 at 11:56:49AM -0500, Gawain Reifsnyder wrote:
> I want to remove files in a directory on my YDL machine that contain
> a certain string. I think I'm getting close but no cigar... I'm
> thinking it's something like:
>
> rm | grep -l 'search string' *

If you don't need recursion, 'grep -l "string" * | xargs rm' will be fine. (I
always pipe to ls first to make sure I'm deleting only what I want though.)

-Hollis



This archive was generated by hypermail 2a24 : Thu May 17 2001 - 10:17:47 MDT