I don't know if this is common knowledge, but here goes ... when using grep on the output of a ps -aux (or similar) command rarely found the line that I was looking for. For example, this would fail:
$ ps -aux|grep stringToSearchFor
Obviously, stringToSearchFor is actually the program I was looking for. I even tried redirecting the ps output to a text file and and then used the cat command in a similar fashion:
$ ps -aux>file.txt
$ cat file.txt|grep stringToSearchFor
Looking at file.txt with TextEdit showed that the output of ps is only as wide as there are columns in the current terminal. Resizing the Terminal only goes so far, and trying to change the COLUMNS environment variable doesn't help either. Thus if the string you are looking for would occur off the terminal screen when ps runs, it doesn't exist. So it is very difficult to find!
$ ps -auxww | grep stringToSearchFor
So using grep as before will now work, as ps will display all of the text for every listed job.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050716043923421