lsof isn’t working for me. I’m trying to use instructions in posts such as How do I find out which program and process ID accesses a given IP address in macOS? to find which process is accessing a specific IP address. But on OSX 10.13 it gives me:
% sudo lsof -i 220.127.116.11
lsof: unknown protocol name (18.104.22.168) in: -i 22.214.171.124 lsof 4.91 latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man usage: [-?abhlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-f[cgG]] [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+|-M] [-o [o]] [-p s] [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [–] [names] Use the “-h” option to get more help information.
what am I doing wrong?
According to the manual page for lsof(8), the syntax should be:
sudo lsof -i @126.96.36.199
(Note the “@”.)
It’s possible the original Answer you were going off of had a typo, or perhaps the syntax for lsof(8) has changed.