[Cialug] lsof! grep?

Todd Walton tdwalton at gmail.com
Sun Jun 29 09:03:24 CDT 2008


lsof | awk '{print $9}' | grep \\.so | sort -u

lsof - lists files that are open, one per line, with some extra info.  nifty.
awk '{print $9}' - snips out the 9th field in the "record"
sort -u - alphabetizes lines of text, showing duplicate lines only once
grep \\.so - ???

grep pulls out only the lines matching the pattern.  But I don't get
what the two backslashes are for.  My output only has lines that
contain a ".so" in them, but surprisingly some of them contain text
after the .so.  I would expect grep to show only lines that end in
.so.  I'm guessing it has something to do with those two backslashes.
'man grep' is not helpful.  ( /\\ )

-todd


More information about the Cialug mailing list