April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Find pid in Solaris 10

Find pid in Solaris 10

If you do not know the pid of a process, you can use “pidof” command in Linux. In case of Solaris, its not available.

Here’s how you can find it:

#ps -ef | grep nscd | grep -v grep | cut -c12-19
123

Here, it will find the pid of nscd. the cut command will cut characters from 12 to 19 from output of ‘ps -ef’ command.
or

#ps -ef | grep nscd | grep -v grep | awk ‘{print $2}’

Here, we use awk to print second column of ps.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>