Where elasticsearch templates are stored?

I would like to know where the elasticsearch templates are stored?

Per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html - IP:9200/_template

Hi Mark,

I would like to know the path of the file they are stored in. I'm asking this because we recently lost these templates suddenly. We had to insert them again through the API.

What version of elasticsearch are you using? Using file based templates, an
amazingly useful feature, was removed in 2.0.

Pre 2.0, they were in config/templates:

https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-templates.html#config