Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

ps ax shows all the running processes. I want to do something similar, but instead of the names of the actual processes, I want the window names listed instead. What Linux command will do this?

share|improve this question

3 Answers 3

up vote 14 down vote accepted

wmctrl -l may be what you're looking for. The wmctrl program can also perform some simple actions on the windows like moving them around and setting their properties.

share|improve this answer

xlsclients shows the running clients and xwininfo -root -children shows all children of the root window. That also includes some stuff your window manager or desktop renders.

share|improve this answer

Here is the way to show names only:

wmctrl -l|awk '{$3=""; $2=""; $1=""; print $0}'

because wmctrl -l shows a bit extra info rather than just names required in the question:

like this:

0x020002c6  0 ruslan-Latitude-E6410 fromscratch
0x04600007  0 ruslan-Latitude-E6410 Psensor - Temperature Monitor
0x01600007  0 ruslan-Latitude-E6410 Top Expanded Edge Panel
0x01600017  0 ruslan-Latitude-E6410 Bottom Expanded Edge Panel
0x0200000a -1 ruslan-Latitude-E6410 Desktop
0x05a0000c  0 ruslan-Latitude-E6410 ruslan@ruslan-Latitude-E6410: /var/lib/apt
0x05600085  0 ruslan-Latitude-E6410 index.html (~/Dropbox/cpucraft.com/fromscratch) - gedit

and filtering it by awk we get only names of open windows:

   fromscratch
   Psensor - Temperature Monitor
   Top Expanded Edge Panel
   Bottom Expanded Edge Panel
   Desktop
   ruslan@ruslan-Latitude-E6410: /var/lib/apt
   index.html (~/Dropbox/cpucraft.com/fromscratch) - gedit
   ubuntu - Get a list of open windows in Linux - Super User - Mozilla Firefox
   cpucraft@cpucraft.com - FileZilla
share|improve this answer

Your Answer

 
discard

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.