Try:
ps -ef|grep X
The ps command will display information about a selection of the active processes (from the man page - man ps). This command will list the location (ie /usr/bin/X)
of x. If you do not get a location then there is no GUI.
decide your linux OS is GUI or not
原文:http://www.cnblogs.com/yxwkf/p/5370608.html