how to know which display number for the variable DISPLAY to be exported when ssh to server

Posted by insidepower on Super User See other posts from Super User or by insidepower
Published on 2010-12-26T04:31:40Z Indexed on 2010/12/26 4:55 UTC
Read the original article Hit count: 179

Filed under:
|
|
|

When i ssh to server using -X, i always confuse about which display number i should export. It seems to me sometimes the display number has been used by something, so what i can do is only

export DISPLAY=localhost:0 && xclock
export DISPLAY=localhost:1 && xclock
export DISPLAY=localhost:2 && xclock
export DISPLAY=localhost:...

until the clock appear. Then i will use that display number. Each time log in to the server, the display number which is able to tunnel the gui data correct would be different.

I know many of such similar questions has been asked and answer. However I couldn't find answer to my question, anyone know about it? Thanks!

© Super User or respective owner

Related posts about linux

Related posts about ssh