【发布时间】:2017-07-31 15:29:12
【问题描述】:
我想查找在 mac 中为某些操作打开的终端数量。不使用top有什么办法吗?
【问题讨论】:
-
用applescript检查[这里](stackoverflow.com/questions/6172663/…)
-
谢谢,@SarilSudhakaran。这正是我想要的
标签: macos shell terminal applescript
我想查找在 mac 中为某些操作打开的终端数量。不使用top有什么办法吗?
【问题讨论】:
标签: macos shell terminal applescript
您可以使用以下命令来获取在 Mac 终端中打开的选项卡数量:
ps -afx | grep "\-bash" | grep -iv "grep" | wc -l
$ ps -afx | grep "\-bash" | grep -iv "grep" | wc -l
4
$
【讨论】:
ps -el | grep bash | wc -l
非常适合我。
【讨论】: