Pretty much what n0cmonkey said.
If your command line prompt is bash, to run bash commands from the command prompt, just put them in a file, make the file executable ("chmod u+x <filename>") and then type "./<filename>.
If your command line prompt isn't bash, type "bash" first.