Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering what commands/utilities can be used in terminal to know the types of windowing system (such as X window system), window manager (such as Metacity, KWin, Window Maker) and desktop environment (such as KDE, Gnome) of a Linux or other Unix-like operating systems?


share|improve this question
So you want to know what's installed, what's default or what's running? – bahamat Feb 14 '11 at 16:14
@bahamat: what is running. That is why I want to know if there are some system files or commands for me to check that. But if you also know how to check for what's installed, what's default, then I also would like to know. Thanks! – Tim Feb 14 '11 at 17:49
What do you want to do with this information? (Windowing system is at least almost always X windows) – pjc50 Feb 15 '11 at 15:38
@pjc50: different types come with different sets of applications. I need the info to decide whether an application is for mine. – Tim Feb 15 '11 at 15:41
For desktop environment, I came across env | grep XDG_CURRENT_DESKTOP. – user15760 May 7 '13 at 17:41

With difficulty.

There is no centralized system for keeping track of these things.

  • On Debian-derived Linuxes you might try the alternatives system.
  • You could query the package manager, and if you find only one Foo installed, you can be pretty sure which Foo is in use.
  • You could try parsing the output of ps. Or equivalently of reading /proc on systems that have it.

Possibly the most reliable thing is to ask the user.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.