I\'d like to use <
grep
to find out if/where an html class is used across a bunch of files. The regex pattern should find not only
How about something like this:
grep -Erno 'class[ \t]*=[ \t]*"[^"]+"' *
That will also allow for more whitespace and should give you output similar to:
1:class="foo bar baz"
3:class = "haha"
To see all classes used, you can pipe output from the above into the following:
cut -f2 -d'"' | xargs | sort | uniq