Check DISPLAY variable with echo $DISPLAY
In this step, we will explore the DISPLAY
environment variable. The DISPLAY
variable is crucial in Linux systems that use a graphical user interface (GUI). It tells graphical applications where to send their output (which screen) and where to get input from (which keyboard and mouse).
When you are working in a terminal within a graphical environment like the one provided by LabEx, the DISPLAY
variable is usually set automatically. Let's check its value using the echo
command, which we learned in the previous lab.
Open your terminal if it's not already open. You can find the Xfce Terminal icon on the left side of your desktop.
Type the following command and press Enter:
echo $DISPLAY
The $
before DISPLAY
indicates that we want to see the value of the DISPLAY
variable, not the literal word "DISPLAY".
You should see output similar to this:
:0.0
The value :0.0
is a common setting for the primary display on a local machine. It means:
:
: Indicates the display is on the local machine.
0
: Refers to the display server number (the first display server).
.0
: Refers to the screen number on that display server (the first screen).
Understanding the DISPLAY
variable is important when you work with graphical applications, especially in remote environments or when troubleshooting display issues.
Click Continue to proceed to the next step.