title: How to detect whether tomcat and ant are installed on linux machine
body: <p>I am trying to install <code>Tomcat</code> and <code>Ant</code> on my linux machine, but before installing them i just need to check whether they are already installed or not.</p>
  
  <p><strong>Regarding tomcat</strong>:</p>
  
  <p>I googled a lot and searched on my machine in the following directories for tomcat</p>
  
  <pre><code>/usr/local/, /opt/, /usr/share/
  </code></pre>
  
  <p>but i din't find tomcat folder in any of the above path, whether it indicates that <code>tomcat</code> is not installed ? so actually</p>
  
  <pre><code>1. what is the path to `look/find` exactly to know/check whether tomcat is installed or not in 
     all linux machines
  2. what will be the path the tomcat will be installed exactly after installation
  3. How to find the version of tomcat on any linux machine (if tomcat already installed) 
  4. Whether there are any commands to look for both whether `tomcat` installed and `ant` 
     installed
  </code></pre>
  
  <p><strong>Regarding Ant</strong>:</p>
  
  <p>I googled and got the below command due to which i got the below result after executing 
  it</p>
  
  <pre><code>sh-4.2$ ant -v
  </code></pre>
  
  <p><strong>result</strong></p>
  
  <pre><code>sh-4.2$ ant -v
  Apache Ant(TM) version 1.8.2 compiled on November 21 2011
  Trying the default build file: build.xml
  Buildfile: build.xml does not exist!
  Build failed
  </code></pre>
  
  <p>so actually</p>
  
  <pre><code>1. Does the above result mean that `Ant` is installed ? or not ?
  2. what is the path to `look/find` exactly to know/check whether ant is installed or not in 
     all linux machines
  3. what will be the path the `ant` will be installed exactly after installation
  4. How to find the version of `Ant` on any linux machine (if Ant already installed) 
  </code></pre>