Get a List of Preferred Wi-Fi Networks from Command Line on Mac

Retrieving a list of preferred wireless networks can be helpful when troubleshooting wi-fi problems, amongst other reasons too. If you’re looking to print out a list of wi-fi networks the Mac has used as preferred and connected to before, the following trick will do just that!