Bootstrap FreeKB - Linux Fundamentals - Understanding the $DISPLAY variable
Linux Fundamentals - Understanding the $DISPLAY variable

Updated:   |  Linux Fundamentals articles

The DISPLAY variable will contain 3 pieces of information:

  • Hostname
  • Sequence Number
  • Screen Number

In this example, the hostname is localhost, the sequence number is 10, and the screen number is 0. The english version of this would be "screen 0 on display 10, on my computer."

[john.doe@server1 ~]# echo $DISPLAY
localhost:10.0

 

In this example, the sequence number is 0 and the screen number is 0. This is very command. This means "the first screen on your main display."

[john.doe@server1 ~]# echo $DISPLAY
localhost:0.0

 

Hostname

The hostname is the name of computer running the X server. When hostname is localhost, this means the local system is the X server.

 

Sequence number

The sequence number can vary based on the number of monitors connected to the computer.

 

Screen number

0 is the default screen number. A system can have numerous screens.




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter e81b66 in the box below so that we can be sure you are a human.