Is there any tool to validate HTML code in Linux?
Yes, certainly. You can download tidy (the HTML syntax checker).
Once downloaded you run it from the command line
$ tidy -e page.html
The above line will just display errors or warnings if any
$ tidy page.html
The above line will display any error or warning and the full HTML page as well
$ tidy -modify page.html
The above line will modify the original input file with a fixed version of it.
For more options, run – of course –$ man tidy.