Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.mac.system > #55060

Re: Question about wildcards in Unix

From Jolly Roger <jollyroger@pobox.com>
Newsgroups comp.sys.mac.system
Subject Re: Question about wildcards in Unix
Date 2014-01-20 18:43 +0000
Organization People for the Ethical Treatment of Pirates
Message-ID <bk592lF4k42U4@mid.individual.net> (permalink)
References (1 earlier) <52dc55d7$0$39541$c3e8da3$50a2033e@news.astraweb.com> <52dc5ccf$0$58768$c3e8da3$12bcf670@news.astraweb.com> <1lfruh8.1ni6lfs1qgbzg2N%dempson@actrix.gen.nz> <52dc73f7$0$9776$c3e8da3$aae71a0a@news.astraweb.com> <1lfrnvi.f2pto8x4qimsN%mcarels@xs4all.nl>

Show all headers | View raw


On 2014-01-20, Maarten Carels <mcarels@xs4all.nl> wrote:
> JF Mezei <jfmezei.spamnot@vaxination.ca> wrote:
>
>> On 14-01-19 18:43, David Empson wrote:
>> 
>> > If the current directory contains a subdirectory which has a name ending
>> > in ".c", then "ls -R *.c" will recursiely list the entire contents of
>> > that subdirectory (and any other similarly named subdirectories in the
>> > current directory).
>> 
>> Ahh. Thanks I understand now.
>> 
>> So, if I want to grep "mystring" in all C programs below current
>> directory, how do I go about it ?
>
> Find is youir friend.
> find . -name \*.c -exec grep mystring {} \;

Yep, find is quite useful; though for this use case, I prefer the
simpler:

grep -rl --include '*.c' 'mystring' .

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

Back to comp.sys.mac.system | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Question about wildcards in Unix JF Mezei <jfmezei.spamnot@vaxination.ca> - 2014-01-19 17:19 -0500
  Re: Question about wildcards in Unix Siri Cruz <chine.bleu@yahoo.com> - 2014-01-19 14:42 -0800
  Re: Question about wildcards in Unix Joanna Shuttleworth <js@example.com> - 2014-01-19 22:46 +0000
    Re: Question about wildcards in Unix JF Mezei <jfmezei.spamnot@vaxination.ca> - 2014-01-19 18:16 -0500
      Re: Question about wildcards in Unix dempson@actrix.gen.nz (David Empson) - 2014-01-20 12:43 +1300
        Re: Question about wildcards in Unix nospam <nospam@nospam.invalid> - 2014-01-19 19:02 -0500
          Re: Question about wildcards in Unix dempson@actrix.gen.nz (David Empson) - 2014-01-20 17:41 +1300
        Re: Question about wildcards in Unix JF Mezei <jfmezei.spamnot@vaxination.ca> - 2014-01-19 19:55 -0500
          Re: Question about wildcards in Unix Jolly Roger <jollyroger@pobox.com> - 2014-01-20 03:00 +0000
          Re: Question about wildcards in Unix mcarels@xs4all.nl (Maarten Carels) - 2014-01-20 10:05 +0100
            Re: Question about wildcards in Unix Tim Streater <timstreater@greenbee.net> - 2014-01-20 09:49 +0000
              Re: Question about wildcards in Unix Doug Anderson <ethelthelogremovethis@gmail.com> - 2014-01-20 12:57 -0800
                Re: Question about wildcards in Unix JF Mezei <jfmezei.spamnot@vaxination.ca> - 2014-01-20 16:15 -0500
                Re: Question about wildcards in Unix Doug Anderson <ethelthelogremovethis@gmail.com> - 2014-01-20 14:10 -0800
                Re: Question about wildcards in Unix Tim Streater <timstreater@greenbee.net> - 2014-01-20 23:06 +0000
                Re: Question about wildcards in Unix Doug Anderson <ethelthelogremovethis@gmail.com> - 2014-01-20 16:39 -0800
                Re: Question about wildcards in Unix nospam <nospam@nospam.invalid> - 2014-01-20 18:44 -0500
                Re: Question about wildcards in Unix Doug Anderson <ethelthelogremovethis@gmail.com> - 2014-01-20 16:42 -0800
                Re: Question about wildcards in Unix Tim Streater <timstreater@greenbee.net> - 2014-01-21 10:23 +0000
            Re: Question about wildcards in Unix Jolly Roger <jollyroger@pobox.com> - 2014-01-20 18:43 +0000
      Re: Question about wildcards in Unix Doug Anderson <ethelthelogremovethis@gmail.com> - 2014-01-20 12:55 -0800

csiph-web