From owner-freebsd-hackers Tue Oct 12 7:59:19 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id D453A1515F for ; Tue, 12 Oct 1999 07:59:15 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.3/8.9.3) id JAA15055; Tue, 12 Oct 1999 09:59:04 -0500 (CDT) (envelope-from dan) Date: Tue, 12 Oct 1999 09:59:04 -0500 From: Dan Nelson To: Zhihui Zhang Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Search a symbol in the source tree Message-ID: <19991012095904.A8849@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i In-Reply-To: X-OS: FreeBSD 4.0-CURRENT Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Oct 12), Zhihui Zhang said: > Can anyone suggest me a way of searching symbols in the entire /usr/src > tree? I normally use grep */*. But grep does not work recursively, right? > Something like a small shell script may do this. Thanks a lot. If you use zsh, it has a "recursive glob": grep draw_mouse **/*.c You could also use find | xargs: find . -name "*.c" | xargs grep draw_mouse Or you could use gtags/global: gtags global -gx "draw_mouse" If you're really looking for the source file that defines a symbol, global is the way to go. -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message