From owner-freebsd-questions@FreeBSD.ORG Sat May 30 16:32:47 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 06E99106566C for ; Sat, 30 May 2009 16:32:47 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id BA0108FC13 for ; Sat, 30 May 2009 16:32:46 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r55.edvax.de (port-92-195-65-8.dynamic.qsc.de [92.195.65.8]) by mx02.qsc.de (Postfix) with ESMTP id 61DDB16C0253; Sat, 30 May 2009 18:32:45 +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 n4UGWdXb001571; Sat, 30 May 2009 18:32:39 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sat, 30 May 2009 18:32:39 +0200 From: Polytropon To: "Zbigniew Szalbot" Message-Id: <20090530183239.a6755d97.freebsd@edvax.de> In-Reply-To: References: 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-questions@freebsd.org Subject: Re: find and searching for specific expression in files 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: Sat, 30 May 2009 16:32:47 -0000 On Sat, 30 May 2009 11:25:12 +0200, "Zbigniew Szalbot" wrote: > Hello, > > Can you please give me a hint how to use find to search for a specific > text within files? One valid solution is to combine find (to find the files) and grep (to search in them). For the combination, you can use the famous back-tics. % grep "expression" `find /path/to/files/ -mtime -2 -print` Of course, there are surely easier, faster and better means, but from this one, I know it just works. :-) Furthermore, I think -print is optional here. If you want to use the Midnight Commander, use Meta-? for a combined dialog: +----------------- Find File ------------------+ | | | Start at: _______________________________[^] | | | | Filename: _______________________________[^] | | | | Content: _______________________________[^] | | | | [ ] case Sensitive | | | | [< OK >] [ Tree ] [ Cancel ] | +----------------------------------------------+ That's what I mostly use. -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...