To get the PID of a process by using the name of the program, pipe the output of the ps command through grep.

$ ps | grep command_name

In this example we will locate the PIDs for the any command with "star" in the name of the process:

$ ps -e | grep star
michael 690 673 0 08:36 ? 00:00:00[start kde]
michael 1348 830 0 1707pts/2 00:00:00[grep star]