【问题标题】:How to find the number of Tabs open in a Mac Terminal如何查找在 Mac 终端中打开的选项卡数量
【发布时间】:2017-07-31 15:29:12
【问题描述】:

我想查找在 mac 中为某些操作打开的终端数量。不使用top有什么办法吗?

【问题讨论】:

标签: macos shell terminal applescript


【解决方案1】:

您可以使用以下命令来获取在 Mac 终端中打开的选项卡数量:

ps -afx | grep "\-bash" | grep -iv "grep" | wc -l

$ ps -afx | grep "\-bash" | grep -iv "grep" | wc -l
       4
$

【讨论】:

    【解决方案2】:
    ps -el | grep bash | wc -l
    

    非常适合我。

    【讨论】:

      猜你喜欢
      • 2018-06-28
      • 2011-11-02
      • 2023-04-04
      • 2019-01-19
      • 1970-01-01
      • 2021-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多