For ROS Hydro and later,
This command will publish messages to a given topic:
rostopic pub
This option (dash-one) causes rostopic to only publish one message then exit:
-1
This is the name of the topic to publish to:
/turtle1/cmd_vel
This is the message type to use when publishing to the topic:
geometry_msgs/Twist
This option (double-dash) tells the option parser that none of the following arguments is an option. This is required in cases where your arguments have a leading dash -, like negative numbers.
--
As noted before, a geometry_msgs/Twist msg has two vectors of three floating point elements each: linear and angular. In this case, '[2.0, 0.0, 0.0]' becomes the linear value with x=2.0, y=0.0, and z=0.0, and '[0.0, 0.0, 1.8]' is the angular value with x=0.0, y=0.0, and z=1.8. These arguments are actually in YAML syntax, which is described more in the YAML command line documentation.
'[2.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'