802.11 physical mode in command line
One correct method seems to be:

system_profiler SPAirPortDataType | awk '/PHY Mode:/ { print $3 ; exit }'


The awk script (between ' ) means:

on first expression 'PHY Mode:', print the third field and exit the script.