Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

- - - - -

See what connections your Mac is making via Terminal [script included]

  • Please log in to reply
No replies to this topic

#1 coolboy4972


  • Members
  • 12 posts
  • Gender:Not Telling
  • Local time:03:56 AM

Posted 25 December 2017 - 04:19 AM

If you've ever wanted to see what your Mac was currently connected to and / or have been daunted by the netstat command's output, I'll offer a lighter solution!


1. Open Terminal

2. Type the following command: lsof -i


+ Alternatively you can save this simple script and save it as a .sh file so it'll be a click away.

+ ps im not sure if it's against the rules to post scripts or attach them so let me know if there's an issue.


while true
    echo -e "[-] Active Connections\n\n"
    lsof -i
    sleep 5

+ I should note that connections are bound to appear such as connections comming from a "Google" process with "https" somewhere around it!

+ A small amount of normal Mac processes will also appear, they're making UDP connections, such as the "SystemUIServer" "loginwindow" etc.

+ If a funny name shows up, look for it's number under the "PID" section and locate the process by it's PID with Activity Monitor.

+ And if you wanna get really technical, lsof -p [PID] will show you all the files opened by the PID in question.


Stay safe and happy holidays!

Edited by coolboy4972, 25 December 2017 - 04:30 AM.

BC AdBot (Login to Remove)


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users