Last Updated: February 25, 2016
· andy_kif

Count items in a long XML file

Want to count items within an XML structure like the one below ?

    <!--maybe thousands of items here-->

Here's a simple line command to do that

cd directory
grep "<item_tag>" filename.xml | wc -l

This will output the exact number of items within your XML structure