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.
|
|