From owner-freebsd-questions@FreeBSD.ORG Sat May 30 11:56:43 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 AE1CE1065672 for ; Sat, 30 May 2009 11:56:43 +0000 (UTC) (envelope-from valentin.bud@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 273718FC0C for ; Sat, 30 May 2009 11:56:42 +0000 (UTC) (envelope-from valentin.bud@gmail.com) Received: by bwz9 with SMTP id 9so6733002bwz.43 for ; Sat, 30 May 2009 04:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=EM5s5g1OusM8/BTBYB1Mf9mQYi9mtOc2NI6u0E4iaQc=; b=BSmCtr3sWuz8m7M23vHSi3JM8cgQDI7yFpD05jpyDsa4X5B215jmjtm7JpNR9Zsxsa 0rwqol132sk2+EzUI3r33C6cF9xD3y69D/wfNmzBkFI0owtnbxGZFCVyYL/dBgGISBYC R0LILqdpiy6Ocz5/4oqkhabYVInTtIiSr5nlY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=FHYcNZW8HssywEcZNq2X/iLtZUL1apzyqGC6D24364hVtshUxcgHn87Dgd79eh5KJ6 A00UjJj0O24qW+QN4iuh807Aiqg3nMfKKpWy7m5TZMKk83oYwR32ZW7ubito3uYCdGqI fmHtxsiX68yQrJZkZiFqEwl6iVbi3w2l6c+Yo= MIME-Version: 1.0 Received: by 10.103.224.17 with SMTP id b17mr2185596mur.61.1243684602115; Sat, 30 May 2009 04:56:42 -0700 (PDT) In-Reply-To: <80cddf609e38046ffa0ce3f2bdab235c.squirrel@relay.lc-words.com> References: <20090530101328.GA59991@owl.midgard.homeip.net> <80cddf609e38046ffa0ce3f2bdab235c.squirrel@relay.lc-words.com> From: Valentin Bud Date: Sat, 30 May 2009 14:56:22 +0300 Message-ID: <139b44430905300456x62bf9c0ybf46bcab6b64e25@mail.gmail.com> To: Zbigniew Szalbot Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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 List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2009 11:56:44 -0000 2009/5/30 Zbigniew Szalbot > >> Can you please give me a hint how to use find to search for a specific > >> text within files? > > > > Generally, you don't - find(1) does not examine the contents of files by > > itself, just their directory information. You normally use grep(1) to > > search within a file. > > Ahhh - I use grep on daily basis. Now why didn't I think of it? I got so > fixed on the idea of using find that I completely forgot about grep.... > > Sorry for the noise and thank you very much for your help! > > -- > Zbigniew Szalbot > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" > Hello Mr. Zbigniew Szalbot, You can use egrep -r * (grep -e) to search for specific text pattern while you are in a directory with many sub directories. The output is nice because it tells you the file in which the text pattern was found :). a great day, v -- network warrior since 2005