|
|||||||||||
|
Re: Search for string in files
From: - Tong - <mlist4suntong(at)yahoo.com>
Date: Sat Aug 25 2007 - 20:25:10 EDT
>> I'm trying to figure out how to find a certain string inside a bunch of I wrote such a perl script as well when in Window$. But now I stick to plain *nix solution -- why bother a script if you can do it with pure *nix command. Try this: grep -Hn 'a_certain_function' `find . -name '*.c'` If the find command returns over hundreds of files, which might yield command line too long error, try this: find . -name '*.c' | xargs grep -Hn 'a_certain_function' You can also substitute grep with agrep for much more advanced searches: agrep text search tool with support for approximate patterns See, the combination of pure *nix command can solve every possible problems you may have, whereas in window$, you have to have thousands of individual tools for thousands of different tasks, and even with the same task, say rename files, you may have to choose from hundreds of tools to pick the one that suits your needs. Yuck. HTH -- Tong (remove underscore(s) to reply) http://xpt.sourceforge.net/techdocs/ http://xpt.sourceforge.net/tools/ -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.orgReceived on Sat Aug 25 20:26:00 2007 This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 02:56:45 EDT |
||||||||||
|
|||||||||||