How To Get Desktop Screen Resolution From Terminal in Linux

You can easily determine your Linux desktop’s screen resolution using command-line tools like xrandr and xdpyinfo.

Check Linux Desktop Screen Resolution using xrandr

Xrandr, the official configuration utility for the RandR (Resize and Rotate) X Window System extension, is readily available in most Linux distributions. To discover your screen resolution using xrandr, simply run below command in the terminal application. You can open terminal app using ctrl+alt+t keys.

xrandr

xrandr

 

This command will display a list of available display settings and your current display resolution. To isolate the current screen resolution in the output, you can use this command:

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

xrandr current

Check Linux Desktop Screen Resolution using xdpyinfo

Xdpyinfo, short for “X Display Information,” is a command-line utility in the X Window System that offers detailed information about the display and the X server’s capabilities.

Also Read:  How to Install Fish Shell on Ubuntu

To retrieve the screen resolution with xdpyinfo, run below command in the terminal app.

xdpyinfo | grep dimensions

xdpyinfo

It comes pre-installed on most Linux distributions. If you don’t have xdpyinfo , you can install it using your distribution’s package manager. For instance, on Ubuntu or Debian, you can use:

sudo apt-get install x11-utils
If you liked this article, please subscribe to our YouTube Channel. You can also stay connected with us on X (Twitter) and Facebook.



Leave a Reply