Last Updated: February 25, 2016
· inuyasha82

Use linux cli to navigate an... XML file

If you have installed the libxml2 package on your linux box (or in windows libxml, libxslt via cygwin) you can navigate through an xml simply using a command line interface (and sometimes it could be very useful).

Just type the following command:
xmllint --shell yourxmlfilename.xml

And now you are into a basic shell for read the xml file.
Here some basic commands:

cd //xpath   it move us insde the specified xpath
ls    it show the current node folder
dir    gives some information about document (or node) structure
cat //xpath   show the content of a node

Obviously there are more commands, these are only basic examples.