Or maybe it's the 'spaces in filename' issue, which is why he did it
with the 'exec' thing instead of the 'print' thing, I'm guessing.
FWIW, my 'standard template' for find is something like:
>> find /home/some_v_host/public_html/ -type f -print0|xargs -0 grep -H
'img' | less
Note the '-print0' and '-0' args. One tells find to use 'null' as the
filename terminator (rather than newline), and the other tells xargs to
use that same null to delimit filenames, rather than 'whitespace'.
Rusty
-----Original Message-----
From:
plug-discuss-bounces@lists.phxlinux.org
[
mailto:plug-discuss-bounces@lists.phxlinux.org] On Behalf Of Paul
Mooring
Sent: Thursday, July 18, 2013 9:00 AM
To: Main PLUG discussion list
Subject: RE: httpd log errors
No problem at all, in this case it's pretty much 6 of one half dozen of
the other. I would guess the cases you're trying to remember are
related to the `-type f` part of find, in a more complicated scenario
find has way more power to selectively choose which files to search
(which comes at a performance cost if these are really large projects).
Grep on the other hand will just naively search all files, including
binary files which surprises some people, I just like to promote the
full power of grep as it's underuse makes my neckbeard itch (please
don't `cat my_file.txt|grep` just grep the file).
Paul Mooring
Operations Engineer
www.opscode.com
________________________________________
From:
plug-discuss-bounces@lists.phxlinux.org
<
plug-discuss-bounces@lists.phxlinux.org> on behalf of
kitepilot@kitepilot.com <
kitepilot@kitepilot.com>
Sent: Thursday, July 18, 2013 8:52 AM
To: Main PLUG discussion list
Subject: Re: httpd log errors
Oops, Paul I answered you too fast and without thinking (imagine that),
so I answered what 'I thought' you were saying instead of what you 'were
saying'!
> Just because I like to be nitpick, why over-complicate?
> grep -r "img" /home/some_v_host/public_html
You are right, in this particular case it can (probably) be done as you
say, but in my experience, I have run into problems that I can't
remember now because I ditched the syntax in favor of 'find' to avoid
them long time ago, and because 'find' is more powerful and allows me
more tricks (with other pitfalls of its on) than grep alone.
I do however recognize that sometimes I am somehow guilty of
'over-complicating' things... ;-)
ET
PS: It's *DIVERSITY* what makes this list *FUN*!!!
kitepilot@kitepilot.com writes:
> 'over-complicate' is relative...
> I rather use those than *ANY* 'Visual Studio' crap! ;-)
> ET
>
>
>
>
> Paul Mooring writes:
>
>> Just because I like to be nitpick, why over-complicate?
>>
>> grep -r "img" /home/some_v_host/public_html
>>
>> Paul Mooring
>> Operations Engineer
>> www.opscode.com
>>
>> ________________________________________
>> From: plug-discuss-bounces@lists.phxlinux.org
>> <plug-discuss-bounces@lists.phxlinux.org> on behalf of
>> kitepilot@kitepilot.com <kitepilot@kitepilot.com>
>> Sent: Tuesday, July 16, 2013 7:52 PM
>> To: keith smith; Main PLUG discussion list
>> Subject: Re: httpd log errors
>>
>> find /home/some_v_host/public_html/ -type f -exec grep -H 'img' "{}"
>> \;
>>
>> :)
>>
>> The best IDE is:
>> vi, make, ctags, find and grep.
>> ET
>>
>>
>>
>> keith smith writes:
>>
>>>
>>>
>>>
>>> Hi,
>>>
>>> I'm looking through my error logs and I have several lines that look
>>> like this:
>>>
>>> File does not exist: /home/some_v_host/public_html/img, referer:
>>> https://www.domain.tld/some_dir/some_script.php
>>>
>>> Usually there is a file and line number to the error. I've been
>>> looking at my code, however I am not finding the problem.
>>>
>>> Any insight into what this error means is much appreciated.
>>>
>>> Thanks!!
>>>
>>>
>>>
>>> ------------------------
>>> Keith Smith
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.phxlinux.org To
subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.phxlinux.org To
subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss