title: Get HDP version through Spark
body: <p>We installed a new Spark version so all folders name are named similar to:</p>
  
  <pre><code>ls /etc/hadoop/
  2.6.4.0-91  conf  conf.backup
  </code></pre>
  
  <p>and from <code>spark-submit</code> we get</p>
  
  <pre><code>spark-submit --version
  Welcome to
        ____              __
       / __/__  ___ _____/ /__
      _\ \/ _ \/ _ `/ __/  '_/
     /___/ .__/\_,_/_/ /_/\_\   version 2.2.0.2.6.4.0-91
        /_/
  </code></pre>
  
  <p>What I need is to identify the spark version - <strong>2.6.4.0-91</strong>. We can do:</p>
  
  <pre><code>ls /etc/hadoop/ | grep [0-9]
  2.6.4.0-91
  </code></pre>
  
  <p>but this approach is not so good (because other folder name with number could be there, etc.)</p>
  
  <p>By <code>spark-submit --version</code> we got</p>
  
  <pre><code>version 2.2.0.2.6.4.0-91
  </code></pre>
  
  <p>while we need only the version - <strong>2.6.4.0-91</strong> , ( <strong>without 2.2.0</strong> )</p>
  
  <p>Any ides how to got the version - without (2.2.0) from <code>spark-submit --version</code>?</p>