From owner-freebsd-questions@FreeBSD.ORG Fri Sep 4 00:24:50 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD8BA106568B for ; Fri, 4 Sep 2009 00:24:50 +0000 (UTC) (envelope-from kline@thought.org) Received: from aristotle.thought.org (aristotle.thought.org [209.180.213.210]) by mx1.freebsd.org (Postfix) with ESMTP id 7000D8FC12 for ; Fri, 4 Sep 2009 00:24:50 +0000 (UTC) Received: from thought.org (tao.thought.org [10.47.0.250]) (authenticated bits=0) by aristotle.thought.org (8.14.2/8.14.2) with ESMTP id n840O3S3034799; Thu, 3 Sep 2009 17:24:04 -0700 (PDT) (envelope-from kline@thought.org) Received: by thought.org (nbSMTP-1.00) for uid 1002 kline@thought.org; Thu, 3 Sep 2009 17:24:41 -0700 (PDT) Date: Thu, 3 Sep 2009 17:24:40 -0700 From: Gary Kline To: Polytropon Message-ID: <20090904002440.GA23859@thought.org> References: <20090902234324.GA1735@thought.org> <20090903020557.2df7c6bf.freebsd@edvax.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090903020557.2df7c6bf.freebsd@edvax.de> User-Agent: Mutt/1.4.2.3i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: With 23 years of service to the Unix community. X-Spam-Status: No, score=-4.4 required=3.6 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on aristotle.thought.org Cc: FreeBSD Mailing List Subject: Re: difficult-to-phrase question... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2009 00:24:50 -0000 On Thu, Sep 03, 2009 at 02:05:57AM +0200, Polytropon wrote: > On Wed, 2 Sep 2009 16:43:30 -0700, Gary Kline wrote: > > i'm looking for a file what contains string "S". the filename > > in this case has a zillion letters, but that beside the point. > > > > i can use grep to find "S" and grep gives me the file[s] that > > have the string. now, is there any easy way of reading that > > file, or deleting or otherwise munging that file? > > I would suggest one of my favourite tools, the Midnight Commander, > available via ports as misc/mc or misc/mc-lite - or from a > package. > > First you run the find dialog, Meta-? (Esc, ?, if you don't have > a Meta key). Enter file mask if needed, starting directory (usu- > ally .) and "S" for the search string. Then a list with the items > found will come up. > > In order to view a file from this list, press PF3 on a file. The > viewer will automatically skip to where "S" has been found in the > file. If you press ENTER on the file, it will be selected in one > of the panels, and you can move or delete it. > > > > > ps: if scripting this is too grizzly i'll do it in C and do an > > inline post of src and example use. > > If you exactly know what to do with the file, scripting might be > the easiest solution. The more interaction, the less optimum it > is. :-) you're right. originally, i was thinking of simplr /bin/rm. find a string, and move that file into some junk file or just remove it. then i thought about viewing it with more|vi. or cp'ing the file. etc. mv seems to have already been invented!! gary > > > -- > Polytropon > Magdeburg, Germany > Happy FreeBSD user since 4.0 > Andra moi ennepe, Mousa, ... -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org The 5.67a release of Jottings: http://jottings.thought.org/index.php 10% slice of my latest novel: http://www.thought.org/10pc