[Tfug] Need command line help regarding searching files for strings...

Ryan Cresawn jrcresawn at gmail.com
Mon Feb 9 16:09:20 MST 2009


Hey Jim,

Start with something like this:

find . -name "*.PDF" -exec grep -l "diebold" {} \;

You could then rerun this for each search term; however, I think you could
shorten that into a single grep command like this:

find . -name "*.PDF" -exec grep -l -E "electronic voting|diebold|second
amendment" {} \;

Both of these suggestions are untested.  Good luck!

Ryan


On Mon, Feb 9, 2009 at 3:59 PM, Jim March <1.jim.march at gmail.com> wrote:

> Folks,
>
> I just downloaded this:
>
> http://thepiratebay.org/torrent/4713076
>
> This is one VERY legit torrent in terms of both legality and morality,
> but it's left me with a problem: 18,000+ files in one directory.
> Nautilus is basically breaking down trying to cope :).
>
> Each report has an index file, a text version and a PDF version.  The
> best descriptors of the reports are in the first page of each .PDF
> report.  So I need to do a command-line search within the directory
> (looking within all .pdf files) for strings like "electronic voting"
> or "diebold" or "second amendment" or the like :).
>
> What's the best way to skin this cat?
>
> Jim
>
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tfug.org/pipermail/tfug_tfug.org/attachments/20090209/ed9952a1/attachment-0002.html>


More information about the tfug mailing list