LFCS · Question #486
Which of the following lines is an example of a correct setting for the DISPLAY environment variable?
The correct answer is B. hostname:displaynumber. The DISPLAY environment variable specifies the X server for graphical applications using the format hostname:displaynumber.screennumber, where displaynumber is essential.
Question
Options
- Ahostname:displayname
- Bhostname:displaynumber
- Chostname/displayname
- Dhostname/displaynumber
- Ehostname
How the community answered
(31 responses)- B87% (27)
- C3% (1)
- D6% (2)
- E3% (1)
Why each option
The `DISPLAY` environment variable specifies the X server for graphical applications using the format `hostname:displaynumber.screennumber`, where `displaynumber` is essential.
The component after the colon should be a numeric display number, not a generic "displayname".
The `DISPLAY` environment variable is used in X Window System to specify the X server where graphical applications should send their output. The correct format is `[hostname]:displaynumber[.screennumber]`, making `hostname:displaynumber` a valid example.
The separator between the hostname and the display identifier is a colon (`:`) not a forward slash (`/`).
The separator is incorrect, and "displaynumber" is the correct term, but the format with `/` is wrong.
Specifying only the `hostname` is insufficient; the `displaynumber` is also required to identify the specific display on that host.
Concept tested: X Window System DISPLAY variable format
Topics
Community Discussion
No community discussion yet for this question.