I have this huge xml file which contains a lot of comments.
Whats the "best way" to strip out all the comments and nicely format the xml from the linux command line?
you can use tidy
$ tidy -quiet -asxml -xml -indent -wrap 1024 --hide-comments 1 tomcat-users.xml <?xml version='1.0' encoding='utf-8'?> <tomcat-users> <user username="qwerty" password="ytrewq" roles="manager-gui" /> </tomcat-users>
2.1m questions
2.1m answers
60 comments
57.0k users