I wasn't complaining about your efficiency. I was looking for some clarity on the first command in case I was going to learn from it.
The second command, well, I was showing a more efficient way of not having to grep for patterns that might match elsewhere. The extra instance I gave of looking for what had port 80 open was of use. lsof usually will try and deref the port to it's name. Therefore on a rpm based machine, a grep for http will end up giving you a lot of apache references. the lsof -i:80 solves the problem by only search TCP port 80. We all learn. And we don't always know from where we will learn. ----- Original Message ----- > Steve, > > You are right. I meant to type: lsof | head -n 1;lsof | grep TCP > > Yes, I know there are other ways that I could have done this to keep a > from doing a couple of shells, but I didn't remember the arguments to > grep off the top of my head. Since it was a keyboard hack I am not > typically worried about another process or two, but if writing systems > scripts where it could be done a lot, it would have still been > prototyped 'easily', but production use would be cleaned up. > > ><> ... Jack > > > On Tue, Dec 18, 2012 at 2:06 PM, Steven S. Critchfield > <[email protected]> wrote: > > > I am not certain the first command does what you report. top is a > > command to look at processes. In fact, the command as you posted > > fails at the option to top. > > -- You received this message because you are subscribed to the Google > Groups "NLUG" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] For more options, visit this > group at http://groups.google.com/group/nlug-talk?hl=en -- Steven Critchfield [email protected] -- You received this message because you are subscribed to the Google Groups "NLUG" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nlug-talk?hl=en
