May 3, 2011

Solaris: pgrep & regular expression

Posted in Solaris at 12:32 pm by alessiodini

Today i did a good discovery!
Using pgrep command is possible integrate regular expression !!!

For example i want know all process that end with ‘d’ character ( usually daemons ).
This is instantly with pgrep:

root@node1 # pgrep -lf ‘d$’
0 sched
1347 /usr/cluster/lib/sc/ifconfig_proxy_serverd
10 /lib/svc/bin/svc.startd
12 /lib/svc/bin/svc.configd
304 devfsadmd
740 /usr/cluster/lib/sc/qd_userd
458 /usr/sbin/nscd
417 /usr/lib/sysevent/syseventd
445 /usr/lib/crypto/kcfd
482 /usr/lib/inet/in.mpathd
1330 /usr/cluster/lib/sc/cl_execd
(…)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: