grep

hi all:
what does the following command do. give me a clear explanation.

ps -ef | grep prg1 | grep -v grep | awk '{print $5}'

any help will be appreciated....

Bankpro :slight_smile:

Did you try it out ? What did you get ? Where did you get stuck ?

Vino, some ppl are just waiting to be spoon-fed :smiley: ... well, or just playing with our nerves :p.

i am not getting any out put......

If you are not getting any output then it means there is no process by the name prg1. Run prg1 and then try.

Hello andrk

we are begginners in unix. if u can help us do it otherwise mind your own business.

i don't think so forums are just to ask only advanced questions in a subject.

True, forums are for everyone. Beginners, experts, outsiders.. everyone.

Rules say

(1) No flames, shouting (all caps), sarcasm, bullying, profanity or arrogant posts. 
(2) No negative comments about others or impolite remarks. Be patient. 
(3) Refrain from idle chatter that does not contribute to the knowledge base. 

Let us not forget that these rules apply to each and every member in the forum.

Cheers'.

A simple answer: that command was probably written to show any process running a program called prg1, but it really shows any process that has prg1 anywhere on the commandline that invoked the process.

Plus, that is not a C question.