Forrest logo
back to the DISPLAY=:2 tool

xephyr:tldr:132b7

xephyr: Start an X application on the new screen.
$ DISPLAY=:2 ${command_name}
try on your machine

DISPLAY=:2 ${command_name} is a command used to set the display environment variable to ":2" and then execute the command specified by ${command_name}.

In Linux and Unix-like systems, the DISPLAY environment variable is used to determine the display server that graphical applications should connect to. It specifies the network address or socket path of the X server where the graphical output will be displayed.

By setting DISPLAY=:2, you are specifying the second X server, typically referred to as "localhost:2", to which the graphical application should be connected.

Then, ${command_name} represents the actual command that you want to execute. It can be any valid command or program that you want to run.

So, when you run DISPLAY=:2 ${command_name}, it sets the display server to the second X server and executes the specified command using that display server. This is useful when you have multiple X servers running on your system and you want to run a command specifically on one of them.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the DISPLAY=:2 tool