An lsof Primer

The tool is aptly called `lsof` because it "lists open files". And remember, in UNIX just about everything (including a network socket) is a file. _I rarely reach for `lsof` and so cannot remember what I did last time (was I asking networking questions or filesystem questions?), let alone remember what I typed last time. _link

* What ports do I have open?

lsof -i | grep LISTEN

* What's active on the network?

lsof -i | grep ESTABLISHED

.

Maybe this can become a safe place for me to remember the questions I ask and how `lsof` can answer. I'll almost certainly want one of these for `netstat` too. :-)