Categories: Linux & UnixUbuntu

How to find ID of the display connected to your Linux system

Mostly, we have only a single display connected to computer systems. However, you can have multiple displays connected to a system.

While working with more than one display, sometimes you might find yourself in a situation where-in you need to perform a display-specific task. For example, taking a screenshot. In these scenarios, you need to know the ID of the display you want to perform the action on.

In this tutorial, we will learn how you can find the ID corresponding to a particular display. Please note that all the commands and instructions mentioned in this article have been tested on Ubuntu

Sponsored
20.04 LTS.

Find Linux display ID

For this, you need to use the Xrandr command. According to the tool’s man page, it “is used to set the size, orientation and/or reflection of the outputs for a screen. It can also set the screen size.”

This command provides a –query (or -q) command line option that displays the current state of the system. The information produced in this case contains IDs of the displays connected to the computer.

Sponsored
$ xrandr --query

For example, here’s the output of the command produced on my system:

$ xrandr --query
Screen 0: minimum 8 x 8, current 1280 x 800, maximum 32767 x 32767
LVDS1 connected primary 1280x800+0+0 (normal left inverted right x axis y axis) 331mm x 207mm
   1280x800      60.00*+
   1024x768      60.00  
   800x600       60.32    56.25  
   640x480       59.94  
   640x400       60.00  
HDMI1 disconnected (normal left inverted right x axis y axis)
TV1 unknown connection (normal left inverted right x axis y axis)
   848x480       59.94 +
   640x480       59.94 +
   1024x768      59.94  
   800x600       59.94  
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

All the IDs are highlighted in bold. As the output reveals, only one display is currently connected to my system.

As for usage, one example could be the command line screenshot taking tool gnome-screenshot that requires display ID to know which screen the user wants to grab.

The post How to find ID of the display connected to your Linux system appeared first on FAQforge.

Ubuntu Server Admin

Recent Posts

From sales development to renewals: Mariam Tawakol’s career progression at Canonical

Career progression doesn’t follow a single path – and at Canonical, we embrace that. Our…

12 hours ago

In pursuit of quality: UX for documentation authors

Canonical’s Platform Engineering team has been hard at work crafting documentation in Rockcraft and Charmcraft…

12 hours ago

Ubuntu 24.10 (Oracular Oriole) reached End of Life on 10th July 2025

This is a follow-up to the End of Life warning sent earlier to confirm that…

1 day ago

Canonical announces Charmed Feast: A production-grade feature store for your open source MLOps stack

July 10, 2025: Today, Canonical announced the release of Charmed Feast, an enterprise solution for…

2 days ago

Ubuntu Adding NVIDIA 575 Driver Support for 24.04 & 22.04 LTS

For NVIDIA users, the latest 575 series driver will be available soon in Ubuntu repository.…

2 days ago

Amarok Released 3.3 with Qt6/KF6 Port & GStreamer Backend

Amarok, the free open-source KDE music player, released new 3.3 version on Tuesday, named “Far…

2 days ago