ps (process list)

5) ps — show the process list of the running Unix processes

Ok, now the right way to do this is to search you process list. To do that you use this:


Be sure that <WHAT YOU ARE SEARCHING FOR> is a substring for a name of the job (unix process) that you are searching for.

Secondly, notice that this specific Unix command has some funny “flags” — aux — that appear without a dash proceeding them unlike other Unix command modifiers you may be used to. Finally, the |grep on the end tells Unix to search all the processes for a matching result. When you |grep, you are filtering. After a space between the preceding flag, type |grep, then space, then the thing to filter for.

So for example, to “grep” for (or search for) all processes that contain the string “car”, I search on my Mac and get

$ ps aux |grep car

And here’s my results:

jason              561   0.0  0.0  4821940   3044   ??  S    Sat06PM   0:00.84 /usr/libexec/SidecarRelay

jason            74549   0.0  0.0  4277500    688 s004  S+    2:18PM   0:00.01 grep car

Finally, notice how this actually returns the grep process itself, because while it is running it also has the word ‘car’ in it, so you see the process basically report itself. (That’s useless because of course that’s not the one you want, so just ignore it.)