Date: Tue, 12 Oct 1999 15:12:52 -0500 (CDT) From: Mohit Aron <aron@cs.rice.edu> To: zzhang@cs.binghamton.edu, freebsd-net@freebsd.org Subject: Re: Search a symbol in the source tree Message-ID: <199910122012.PAA23666@cs.rice.edu>
next in thread | raw e-mail | index | archive | help
> 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. Rather than using something equivalent to a recursive grep (which is slow), I prefer to use etags. This gives me the flexibility of searching for symbols from within emacs where emacs directly takes me to the section of code that defines the symbol. To use, first create a TAGS file with the following command: find /usr/src/sys/ -name \*.[ch] -print | etags - This'll create a TAGS file in the current directory for the kernel source. Then from within emacs, commands such as: M-x find-tag (also bound to M-.) are available to search for symbols in the TAGS file. To do a general regexp search on the code for anything whatsoever, you can use: M-x tags-search - Mohit To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199910122012.PAA23666>