[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: GREP



On Fri, 20 Oct 2000, Erik Steffl wrote:

>   yes, that's true, are you asking what the '?' is or are you just
> stating the fact? anyway, the other command is find, see manpages for
> find and grep for more info. find is the one that finds file (based on
> name, time last accessed, type and various other criteria), grep
> searches the files for string (regular expression). xargs is often
> useful in commands like this:
> 
>   find / -name '*.h' -print | xargs grep '[sf]printf'

Just curious, but is this any better/worse than doing a

find / -name '*.h' -exec grep '[sf]printf' {} \;

My way seems more straightforward, but I'm not sure about differences in
processing time, when the first match would be found, etc.

Damian Menscher
-- 
--==## Grad. student & Sys. Admin. @ U. Illinois at Urbana-Champaign ##==--
--==## <menscher@uiuc.edu> www.uiuc.edu/~menscher/ Ofc:(217)333-0038 ##==--
--==## Physics Dept, 1110 W Green, Urbana IL 61801 Fax:(217)333-9819 ##==--



Reply to: