How do I detect the installed version of Elasticsearch via the command line?

curl -XGET -s 'http://localhost:9200' | grep number

2024-07-28--22-28-23