How to Get Current Screen Resolution from Command Line on Mac

To output your Mac’s screen resolution via your command line, run the following command in your terminal:

system_profiler SPDisplaysDataType |grep Resolution

This will output your Mac’s current internal screen resolution, in my case the output is:

Resolution: 2880 x 1800 Retina

If you have external screen devices connected to your Mac while running the command above, your terminal will output their resolution as well.