Thursday, March 24, 2011

View all network connections on OS X

If you're interested in seeing which of your Mac applications are connected to the internet you can try running the lsof (list open files) command.

1. Open Terminal.app (found in Applications -> Utilities)
2. Type lsof -i
3. Hit ENTER

lsof will now show you the list of network connections. If you have administrative rights you can run "sudo lsof -i" to see *all* connections, even those made by system processes such as daemons.

lsof outputs a variety of information by default but we're mostly interested in:

  • COMMAND - The name of the command or program
  • PID - Process ID of the connected program, you can use this to get more information about the program later. e.g You can look for this PID in Activity Monitor.app to see more statistics
  • USER - The name of the user running this app, usually this is your user name or "root" if the process is a system service/daemon
  • NAME - The address and port the application is connected to. If you see something similar to *.* or *: that means the application is listening for connections.

1 comment:

  1. The King Casino - Herzaman in the Aztec City
    The King Casino in Aztec City is https://vannienailor4166blog.blogspot.com/ the place where you can find herzamanindir.com/ and play wooricasinos.info for real, real money. Enjoy a memorable stay goyangfc.com at this one-of-a-kind https://jancasino.com/review/merit-casino/ casino

    ReplyDelete