One of my favorite components of Mac OS X is the underlying UNIX-based Terminal.
The Terminal has lots of valuable tools that give you insight information about the processes that are running, the system etc.
This article is going to use one of these tools, the “lsof” command, to show all running processes / applications, which are accessing the Internet.
Here is how to:
– Fire up the Terminal app (you can find it on Applications/Utilities, or simply type terminal on the Spotlight)
– Run the following command:
lsof -i -n -P
Depending on how many open applications are accessing the Internet, you might get a shorter or longer list of results. The first column of the results is showing the process name, and the last columns are showing the port type, port number, corresponding target IP addresses, and the connection status (e.g. established).
If you would like to have host names rather than IP addresses, omit the command’s -n switch:
lsof -i -P
Moreover if you want information for a specific application only, for example Firefox, type:
lsof -i -n -P | grep firefox
As a reference only, the -P switch inhibits the conversion of port numbers to port names, and the -i switch can be used to filter IP addresses. If you would like to find more about the “lsof” command, type “man lsof” on your Terminal.