user3060126
user3060126

Reputation: 501

Command Line Search Through Folder - Multiple Options

How can I use the command line to search through a folder of html and css files identifying html files that:

Upvotes: 0

Views: 25

Answers (1)

Craig
Craig

Reputation: 167

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.

Using regular expressions to parse HTML: why not?

Upvotes: 1

Related Questions