well, at first, if you would kill every process not associated with a terminal, your machine would go down within nanoseconds. There are alot of importat processes running that arnt associated with a terminal.
Piping isnt realy that hard, just takes a tad of imagination.. (;
kill $(ps aux | grep pr[o]gram | cut -d " " -f 6)
$(command) # is replaced with the output of the command
| grep pr[o]gram # will search for the process we want. one letter in  to acoid the grep we just made to be caught
| cut -d " " -f 6 # we cut the output, preserving only the 6th field, where fields are seperated by a space.