Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 52 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 '14 at 10:19
1  
It displays the current resolution on a MacBook Pro 2011 model, running Mavericks. – daviewales May 20 '14 at 14:43
1  
It shows the current resolution on a MBP with OSX 10.9.4 – aymericbeaumet Aug 21 '14 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 the utility screenresolution to get the screen resolution:

$ /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 '14 at 4:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .