Count search results on Linux shell
Lets imagine you want to search for a term in a file and you want to know, how often it can be found in the file. With this command combination you can count search results on bash:
1 |
$> less xmlfile.xml | grep SearchmeIfYouCan | wc -l |
This is how this way to count search results works: The input file is opened in less. Afterwards […]