1

Opening my Network preferences screen in Mojave 10.14.2 on my MacBook Pro 2017 takes about two minutes, due to the massive number of network configurations that were automatically installed when I once attached a USB walkie talkie.

Is it possible to delete all these connections at once? Clicking to delete them one by one is incredibly slow due to the UI hanging after removing one.

Network preferences with literally 1000 network connections
Network preferences with literally 1000 network connections

  • Can you click one and then hold down the command key and then click the last one. it should select all in betwen those 2 selections. – jmh Jan 23 at 16:24
  • This does not appear to work in Mojave. Does it work for you? – Paul Lammertsma Jan 23 at 20:08
3

You can use the Terminal to delete them out:

Usage: networksetup -removenetworkservice <networkservice>
    Remove the service named <networkservice>. Will fail if this is the only service on the hardware port that <networkservice> is on.

To get it to list then remove all the ones with MT65XX you'd need to do something like:

$ services=("${(@f)$(networksetup -listallnetworkservices | grep MT65XX | sed s/\*//)}")
$ for service in $services[@]; do networksetup -removenetworkservice $service; done

That this does is builds a list of services by running:

networksetup -listallnetworkservices | grep MT65XX | sed s/\*//

The @f splits the list on newlines, ignoring spaces. The grep finds just the MT65XX lines, and the sed removes any *, which denote disabled services in the output.

Then, for each of those, it runs the networksetup -removenetworkservice step.

  • Thanks for the detailed response! It set me on the right path although I'm afraid that command specifically gave me a syntax error. Trying to remove a single service unfortunately gives "You cannot remove MT65xx Preloader 56 because there aren't any other network services on MT65xx Preloader." – Paul Lammertsma Jan 27 at 23:57
  • I'm currently running the following command to first disable the services, but it's taking quite some time: networksetup -listallnetworkservices | grep MT65xx | while read -r service; do networksetup -setnetworkserviceenabled $service off; done – Paul Lammertsma Jan 27 at 23:58
  • I've figured out I needed to execute with -deletepppoeservice; I'm not sure if disabling the service was required first, but in any case this is what I ended up using: networksetup -listallnetworkservices | grep MT65xx | sed s/\*// | while read -r service; do networksetup -deletepppoeservice $service; done – Paul Lammertsma Jan 28 at 0:09
  • Thanks so much for your answer! It pointed me towards the solution. – Paul Lammertsma Jan 28 at 0:09
  • Great, I'm glad it worked for you. – Alex Jan 28 at 3:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .