More than one way to skin the cat...
I do tend to use
grep a lot for things like this.
For the Peanut Gallery ... when you see a construct like
lsof | grep foo, that's a nifty Unix trick called
'piping." Basically, the output of the "lsof" command, which would normally spew out onto your terminal window, is "piped into" a second command, "grep", whose purpose happens to be to filter whatever is piped into it and to spit out only what matches the filter (namely:
foo).
Almost always, "there's more than one way to do it." (In fact, a very smart guy named Larry Wall all but
trademarked that phrase, known to Perl programmers the world over as
TMTOWTDI.) So, when someone tells you about "yet another way to do it," just smile appreciatively.