How can I use the command line to search through a folder of html and css files identifying html files that:
- Have divs with class .highlight
- Have img tags
- Do not have divs with class .main
How can I use the command line to search through a folder of html and css files identifying html files that:
For simple queries you can use grep (avaliable on *nix platforms usually, can install on Windows as well) which uses regular expressions, but that would only work in one case here. For your image tags:
grep -R <img *.html
Otherwise you would actually need a parser because what you are talking about requires parsing html tags and examining their contents. There are many libraries out there for this- but it's not something built into the command line.