Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm seeing tons of error logs on our site that are looking for favicon.ico. The favicon is now hosted off of amazon S3 but it appears somewhere we still have a link to the old one that I can't find anywhere (I'm a new employee here so I'm not too familiar with things). How can I do a grep search for favicon.ico that doesn't start with ?

share|improve this question
up vote 3 down vote accepted
cat stuff | grep -v '' | grep favicon.ico

Explanation: grep -v returns everything that doesn't match. So, throw away everything that has '' in it, then look through the remainder for 'favicon.ico'. You could swap those around as you like.

share|improve this answer
I'd do this the other way around (grep for favicon before inverse grep for amazon) as the favicon.ico search will return far fewer items for the inverse grep to process than the other way around. – Jon Lasser Mar 25 '10 at 17:59
You might want to to grep -vH '' [filenames] | grep favicon.ico as it will give you the name of the file the line was found in. – Chris S Mar 25 '10 at 18:46
How can I tell it to search everything from the current directory and beyond? – Webnet Mar 25 '10 at 20:41
grep -rv '' . | grep favicon.ico would do it. That -r and the . means "recursively from some location", . is "here". – Bill Weiss Mar 29 '10 at 14:30

Many browsers look for favicon.ico files locally, regardless of whether the location is specified in your HTML. Therefore it's quite possibly not an error in your files, and you should simply ignore these errors when they present themselves.

share|improve this answer
Or add a redirect to wherever it is you're hosting that image. – McJeff Mar 25 '10 at 18:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.