Re: Finding files which does not contain a specific string

From: all mail refused (elvis_at_notatla.org.uk)
Date: 06/18/04


Date: 18 Jun 2004 17:03:42 GMT

In article <3c4shlto.fsf@online.no>, Peter J. Acklam wrote:

>First I'd build a list of all the files
> find DIR -type f | sort > all.tmp
>
>Then I'd build a list of all files which *do* contain "string"
> find DIR -type f -exec grep -q 'string' {} \; -a -print | \
> sort > with-matches.tmp
>
>Then I'd compare the two files and print those without matches
> comm -13 matches.tmp all.tmp
>
>Maybe not the most efficient, but it works.

find2perl, slurp mode

-- 
Elvis Notargiacomo  master AT barefaced DOT cheek
http://www.notatla.org.uk/goen/


Relevant Pages

  • Re: Finding files which does not contain a specific string
    ... In article, Peter J. Acklam wrote: ... >Then I'd compare the two files and print those without matches ... > comm -13 matches.tmp all.tmp ...
    (comp.unix.shell)
  • Re: Finding files which does not contain a specific string
    ... In article, Peter J. Acklam wrote: ... >Then I'd compare the two files and print those without matches ... > comm -13 matches.tmp all.tmp ...
    (comp.unix.questions)
  • Re: How do you pronounce Delphi
    ... (Compare "Evia" for "Euboia"!) ... Peter J. Veger, Best, Netherlands ...
    (borland.public.delphi.non-technical)
  • Re: [RFC] Games::Sudoku::General
    ... Peter J. Acklam wrote: ... I see no reason why it would not do the London Times Quincunx, but getting the topology entered is going to be a major pain. ... I can imagine splitting relevant functionality into ...
    (comp.lang.perl.modules)
  • Re: A more advanced comm utility....
    ... > I'm looking for something very much like 'comm', ... > when that compare happens, I want to restrict it to certain ... while getopts 123c:C: opt ...
    (comp.os.linux.misc)