Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I get the current display resolution from the command line in OS X?

share|improve this question

3 Answers 3

up vote 38 down vote accepted
system_profiler SPDisplaysDataType | grep Resolution
share|improve this answer
4  
On a Macbook pro (10.8.3) this only returns the LCD's max resolution, not the current/selected display resolution. –  studgeek Jun 3 '13 at 16:12
1  
On my Air running 10.8.4 with an external display, this shows both the Air's resolution and the external display's resolution, on separate lines. –  Jim Stewart Jul 9 '13 at 21:59
    
@studgeek I'm not sure if this is still an issue, but on my Air it displays the current resolution. It's very strange the the Pro would alter this behaviour. –  Gerry May 10 at 10:19
1  
It displays the current resolution on a MacBook Pro 2011 model, running Mavericks. –  daviewales May 20 at 14:43
1  
It shows the current resolution on a MBP with OSX 10.9.4 –  aymericbeaumet Aug 21 at 12:28

For a quick reading on the current virtual resolution of a single retina display:

$ osascript -e 'tell application "Finder" to get bounds of window of desktop'
0, 0, 2048, 1280

Results for multi-monitor setups vary based on which display is primary and how they are arranged. Read more here

share|improve this answer

I use this utility to get the screen resolution:

https://github.com/jhford/screenresolution

$ /usr/local/bin/screenresolution get 2>&1 | grep -oE 'Display 0: [0-9]+' | grep -Eo '[0-9]+$'  
1920
share|improve this answer
    
thank you @Mark –  cwd Nov 25 at 4:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.