Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listing Daemon Processes Only

Status
Not open for further replies.

SteveR77

Programmer
Sep 18, 2000
813
US
I know that I have the ability to use the ps command to list only the processes that have been started by the root by doing the following

ps -efx | grep '^[<tab><space>]*root' | more


Is there a better way to extract just the daemon processes?

Thanks in advance,

Steve
 
You could create list file for all of the daemon process and do this:

for PROC in `cat ${DIR}/list.txt`
do
commands
done
 
in solaris use the bin ps, not the /usr/ucb/ps, you will find a lot of new features, so
try

/bin/ps -efocomm,pid | grep 'd '

the arg to grep is a lower d followed by a space


 
Pardon me, but it may be better to pick out processes not associated with a terminal, rather than relying on all daemon processes ending with a d (which they don't, really)

Have a look at the output of your ps command, the solaris version lists unnasociated processes like this:

17420 ? 0:06 dtwm

Look for question marks in the second field of the output. Mike
________________________________________________________________

&quot;Experience is the comb that Nature gives us, after we are bald.&quot;

Is that a haiku?
I never could get the hang
of writing those things.
 
Thank you for your feedback everyone.

The information that you have provided has been helpful.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top