简体   繁体   中英

find number of gnome-terminal tabs currently open by window Id

How can I find the number of open tabs in my terminal?

I can get the Id of the window by using xwininfo -name and giving a name of one of the tabs. For example:

xwininfo -name "<name of a tab>" on my machine resulted in:

xwininfo: Window id: 0x3000006 "<name of tab>"

...some more info

Is there a way to know the number of tabs currently open? I'm using Ubuntu with tcsh but bash solutions are welcome also because they may hint for the solution with tcsh .

你可以尝试这样的事情:

ps --ppid $(pgrep gnome-terminal)  | grep tcsh | wc -l

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM