How to find screen resolution in Linux desktop environment

One system setting that you often check or modify in Linux desktop environment is display setting, in particular, screen resolution. There are different ways to get display resolution information on Linux, either from the command line or from GUI-based display settings.

In this tutorial, I will describe how to find screen resolution in Linux desktop environment.

Method One

One way to determine monitor resolution is via xdpyinfo, a command-line utility for showing information about an X server, including current display resolution. To check the current screen resolution from the command line, simply run:

$ xdpyinfo | grep "dimensions" | awk '{ print $2 }'

Method Two

The second screen resolution command is xrandr, a command-line interface for RandR (short for "X Resize, Rotate and Reflect Extension"). The xrandr command can show you the current screen resolution, as well as all possible display settings.

$ xrandr
Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y
axis) 344mm x 194mm
   1366x768       60.0*+   40.1
   1360x768       59.8     60.0
   1024x768       60.0
   800x600        60.3     56.2
   640x480        59.9
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)

As you can see above, if you run xrandr command without any argument, you can get a list of all available screen resolutions. The currently set screen resolution is indicated with "*" marker. Therefore, to find the current display resolution only, use the following command.

$ xrandr | grep '*' | awk '{ print $1 }'

Method Three

Every Linux desktop environment comes with its own GUI-based system settings, including display settings. Thus, you can use GUI-based display settings to determine the current screen resolution. To launch GUI-based display settings, you can use desktop-specific command line interface as demonstrated below.

To launch display settings on GNOME desktop environment, use either of the following commands:

$ gnome-control-center display


$ gnome-display-properties

To launch display settings on KDE desktop environment, run:

$ kcmshell4 display

To launch display settings on LXDE desktop environment, run:

$ lxrandr

To launch display settings on Xfce desktop environment, run:

$ xfce4-display-settings

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

The following two tabs change content below.
Dan Nanni is the founder and also a regular contributor of He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.

One thought on “How to find screen resolution in Linux desktop environment

  1. Re. Method #1.

    Thanks for the tip. xdpyinfo set me on the right track.
    I often see people use grep to grab a line from a stream and then awk to print a field from that line. Both can easily be done in awk. The following does the same thing, but uses fewer resources and runs faster:

    xdpyinfo | awk '$1 == "dimensions:" { print $2 }'

Leave a comment

Your email address will not be published. Required fields are marked *