了解linux DISPLAY变量 [英] Understanding linux DISPLAY variable
问题描述
我是Linux新手,必须设置DISPLAY变量才能运行Java应用程序.我设法做到了这一点,并且我知道可以使用
I am new to Linux and I had to set DISPLAY variable for running a java application. Somehow I managed to do that, and I understand that display can be set using
<host>:<display>[.<screen>]
但是我正在做的是:1001.
but what I am doing is :1001.
现在,此1001是此linux的第1001个显示?一台机器上可能有这么多显示器吗?或者我的理解是错误的?
Now, this 1001 is 1001th display of this linux? Are this many display possible in a machine or my understanding is wrong?
推荐答案
X11 使用 DISPLAY
变量来标识您的显示(以及键盘和鼠标).通常在台式机上是:0
,指的是主显示器等.
The DISPLAY
variable is used by X11 to identify your display (and keyboard and mouse). Usually it'll be :0
on a desktop PC, referring to the primary monitor, etc.
如果您将SSH与X转发( ssh -X otherhost
)一起使用,则它将设置为类似 localhost:10.0
的名称.这告诉X应用程序发送其输出,并从TCP端口 127.0.0.1:6010
接收输入,该端口将通过SSH转发回您的原始主机.
If you're using SSH with X forwarding (ssh -X otherhost
), then it'll be set to something like localhost:10.0
. This tells X applications to send their output, and receive their input from the TCP port 127.0.0.1:6010
, which SSH will forward back to your original host.
是的,回想过去,瘦客户端"计算意味着 X终端,通常有数百台显示器连接到同一主机.
And, yes, back in the day, when "thin client" computing meant an X terminal, it was common to have several hundred displays connected to the same host.
这篇关于了解linux DISPLAY变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!