From owner-freebsd-questions@FreeBSD.ORG Thu Sep 3 00:06:00 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 49FAD1065670 for ; Thu, 3 Sep 2009 00:06:00 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 085E98FC13 for ; Thu, 3 Sep 2009 00:05:59 +0000 (UTC) Received: from r55.edvax.de (port-92-195-1-225.dynamic.qsc.de [92.195.1.225]) by mx01.qsc.de (Postfix) with ESMTP id 9E8923CCF0; Thu, 3 Sep 2009 02:05:58 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id n8305vIb001849; Thu, 3 Sep 2009 02:05:58 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 3 Sep 2009 02:05:57 +0200 From: Polytropon To: Gary Kline Message-Id: <20090903020557.2df7c6bf.freebsd@edvax.de> In-Reply-To: <20090902234324.GA1735@thought.org> References: <20090902234324.GA1735@thought.org> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Mailing List Subject: Re: difficult-to-phrase question... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2009 00:06:00 -0000 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. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...