13.2 Displaying processes
13.2.2 Searching for a specific process
As mentioned earlier, in order to stop a process you must find the Process ID. On most systems there are hundreds of processes running and the ps -ef listing can be quite long. If you know the name of the executable program that started the process, you can find the PID faster. By piping the output of the ps command through grep, you can search for the specific process you want to terminate and determine the correct PID. As you will recall, the grep command can search for any type of character string in the output of another command. Specific to Solaris is the pgrep command used to search for a specific process. The -l (long output) option will display the names of the processes associated with the PID found. Figure compares the ps -e command using grep with pgrep -l. The -e option displays the PID and the name of the initiating command, which allows grep to search on this information.
Interactive Media Activity (Flash, 92 kB)
  Displaying System Processes

In this media activity, you are logged in as user2 and your current working directory is: /home/user2. Type the commands that would accomplish the requested objectives.
Note: Be sure to press enter after each one. Click on step 1 to begin.