2017-07-31 21 views
1

我想查找某些操作在mac中打開的終端數量。有沒有辦法做到這一點,而不使用頂部?如何查找在Mac終端中打開的選項卡數量

+1

要做到這一點與蘋果腳本檢查[這裏](https://stackoverflow.com/questions/6172663/how-can-i-tell-in-script-how-many-terminals-are-open-in-mac -os-x) –

+1

謝謝,@SarilSudhakaran。這正是我想要的 – ShdwKnght333

回答

0

您可以使用下面的命令來獲得一臺Mac終端選項卡中打開的數量:

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

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

工作非常適合我。

相關問題