code: public static boolean checkExistence(String cmd) {
      StringBuffer sb = runCommand("which " + cmd);
      if (sb.length() > 1)
        return true;
  
      return false;
    }
docs: Checks whether a specific shell command is available
  in the system.
  
  @param cmd the command to check against
  
  @return true, if the command is availble, false otherwise