ton*_*sid 28 linux ubuntu ubuntu-10.04
ps ax 显示所有正在运行的进程。我想做类似的事情,但不是实际进程的名称,而是列出窗口名称。什么 Linux 命令会做到这一点?
这是仅显示名称的方法:
wmctrl -l|awk '{$3=""; $2=""; $1=""; print $0}'
因为wmctrl -l显示了一些额外的信息,而不仅仅是问题中所需的名称:
像这样:
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
Run Code Online (Sandbox Code Playgroud)
并通过awk我们只得到打开窗口的名称来过滤它:
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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
36601 次 |
| 最近记录: |