1
vote
2answers
624 views

getting first non display number in use

I need to give a command like Xvfb :6 -screen 0 1024x768x24 Where 6 can be a display number. Now Xvfb can already be using that Display, so how do I get the first display number not in use?