Below is my command,i am using ubuntu machine.
java -cp “testng jar file path:path of class files” org.testng.TestNG testng.xml
java -cp “/home/user/Documents/eclipse/plugins/org.testng.eclipse_6.11.0.201703011520/lib/*:/home/user/Documents/APPIUMWorkSpace/EOneMobile/target/classes/” org.testng.TestNG /home/user/Documents/APPIUMWorkSpace/EOneMobile/testng.xml
my testngxml file is:
<?xml version="1.0" encoding="UTF-8"?>