Thanks, lleb.
I just did a quick search on the web.
According to one of the site I bumped into that xrandr command can detect connected to displays.
I'm not sure whether this will work on all distros.
But I hope there will be a universal command for all distros, so it would be nice and need to remember only one command that works for all.