how to know which display number for the variable DISPLAY to be exported when ssh to server
- by insidepower
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!