Despite, or maybe thanks to, being a duplicate I like this [Wayback/Archive] command line – How can I view all Wi-Fi network names (SSIDs) in my area in the terminal? – Ask Different (thanks [Wayback/Archive] Jandroid and [Wayback/Archive] Ray de Groat)
The reason is that unlike similar questions it has a single answer that works on more recent MacOS versions:
system_profiler SPAirPortDataType
I usually amend it with | less for easier browsing.
It means this question skips all kinds of answers with commands that over the course of time Apple has decided to kill and now no longer work or only work as admin:





