1
vote
2answers
472 views

How to find files that don't contain a given search string

I have a command that finds all the PDF files that contain the string "Font" find /Users/me/PDFFiles/ -type f -name "*.pdf" -exec grep -H 'Font' '{}' ';' How can I change this command such that it ...
18
votes
1answer
451 views

Why bracket a single letter in a grep regex?

I've seen several instances where people are doing this: grep [f]oobar But I don't understand why that is preferable to grep foobar
1
vote
1answer
100 views

Regular expressions in GREP [closed]

I have an .xml file. The tags inside are: <Info>Product</Info> Now, I have 20 000 tags like this in the file. One tag however, starts properly but it is missing a proper closing tag. ...
0
votes
3answers
375 views

grep out unique senders from a huge list of emails

I just found a huge list of emails under my user account in Centos /home/user/mail/new I opened some of them and noticed they were sent from a particular cron job. From address is root@hostname.com. ...
-2
votes
1answer
47 views

matching any part of a expression using grep

How Can I use grep so as to return me all matches for not only entire expression but also any part of the expression. example: grep "foobar" foo where foo contains text foo should give me a match ...
1
vote
2answers
136 views

Need help with grep urgently to comply with subpoena request

I am not a system administrator but I run a little website and today I have received a subpoena request from police, in order to comply I need to extract IP addresses from our server logs for needed ...
0
votes
4answers
5k views

non greedy grep command on ubuntu?

I'm building a script which filters out all our translatables from our template system. the problem i'm facing is the occasion where 2 translatables are on one line. These are 2 example lines from a ...
2
votes
2answers
8k views

grep to find files that contain a string greater than x characters long?

Is it possible to locate files in a directory that have strings (with no spaces) longer than x length?