nerdexam
LPI

102-500 · Question #206

Which of the following lines is an example of a correct setting for the DISPLAY environment variable?

The correct answer is B. hostname:displaynumber. See the full explanation below for the reasoning.

Question

Which of the following lines is an example of a correct setting for the DISPLAY environment variable?

Options

  • Ahostname:displayname
  • Bhostname:displaynumber
  • Chostname/displayname
  • Dhostname/displaynumber
  • Ehostname

How the community answered

(69 responses)
  • A
    7% (5)
  • B
    75% (52)
  • C
    1% (1)
  • D
    3% (2)
  • E
    13% (9)

Community Discussion

7
Imani T.Imani T.Feb 12, 2026

B is the one you want. The DISPLAY variable uses a colon separator between the hostname and the display number, like hostname:0 or hostname:0.0, because that is the X Window System syntax and the number refers to which display server instance to connect to, not a name.

19
Orla P.Orla P.Feb 14, 2026

Imani has it right on the colon syntax, though worth noting that when you are connecting locally the hostname part is usually omitted entirely so you will just see :0 or :0.0, which trips people up the first time they run echo $DISPLAY on a local desktop versus an SSH session.

0
Carlos M.Carlos M.Feb 16, 2026

The format is hostname:displaynumber, so B is the one they want. A trips people up because "displayname" sounds plausible if you have never actually set DISPLAY by hand, but X uses numbers, not names, so you end up with something like :0 or mybox:0.0 where the second number after the dot is the screen number. The slash variants C and D are just wrong, DISPLAY uses a colon as the separator. E might work in some shorthand context locally but it is not a correct full example of the variable format.

5
Bao N.Bao N.Feb 18, 2026

Yeah, the only thing worth adding is that on a box with just one screen you almost never see the .0 in practice even though it is technically implicit, which can make people think the screen number is optional when really the default just quietly fills it in.

0
Orla P.Orla P.Feb 26, 2026

I almost went with A because "displayname" sounded like something you'd set for a named session, but then I remembered the DISPLAY variable uses a numeric identifier for the display, not a name, so the format is hostname:displaynumber, which locks in B.

2
Bao N.Bao N.Feb 8, 2026

D has to be right because the slash separates the host from the display identifier just like a file path does, and the term "displaynumber" matches the actual numeric value X uses internally, so hostname/displaynumber fits both the syntax and the naming convention perfectly.

0
Orla P.Orla P.Feb 10, 2026

The colon is the actual separator in X display syntax, not a slash, so hostname:displaynumber is the correct form and that is what B shows. The slash reading makes sense intuitively but the X protocol spec is specific about using a colon there.

0
Full 102-500 Practice