grep problem

How can I obtain the item number X from a line returned by the command grep?
Who is Participating?
henrysConnect With a Mentor Commented:
pipe output of grep to awk
For example, to get the process ID from a `ps` listing:
% ps -ef | grep inetd | awk '{print $2}'  (SysV)
 ps -aux | grep inetd | awk '{print $2}'   (BSD)
Brian UtterbackPrinciple Software EngineerCommented:
Huh?  Please give an example.
jjescriAuthor Commented:
Thank you very much, U.henrys.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.