Weka is a collection of machine learning algorithms for data mining tasks. The algorithms can either be applied directly to a dataset or called from your own Java code. Weka contains tools for data pre-processing, classification, regression, clustering, association rules, and visualization. It is also well-suited for developing new machine learning schemes.

To evaluate clustering methods on a dataset from command line, you can use something like

java -cp weka.jar; weka.clusterers.ClusterEvaluation 
  weka.clusterers.SimpleKMeans -t weather.arff

where the Java option ``cp'' is used to give the location of the Weka jar file. ``weka.clusterers.SimpleKMeans'' is the name of the clustering method, ``-t'' is an option for the ClusterEvaluation for giving the training file. Similarly, you can execute other Weka classes from the command line, look at the documentation of the specific classes for the various options which they take. Look at the link http://www.oefai.at/~alexsee/WEKA/ for a tutorial on using Weka from command line.

Source: Weka FAQ