如何显示macOS上正在运行的进程的列表?

时间:2018-12-28 06:32:48

标签: macos terminal ps

我想使用 let JSON_In = [ [ "Payment mode", "Amount" ], [ "Cash", 1355774, "Swiggy", 38560, "KB", 0, "BigBasket", 0, "Zomato", 0, "OMC", 0, "CBOnline", 0, "DineOut", 0, "sodexoCpnCard", 0, "PhonePe", 0, "Mobiwiki", 0, "CreditCard", 0, "Coupn", 0, "Paytm", 0, "CreditAmt", 0 ] ]; let JSON_Out = []; JSON_Out.push( JSON_In[0] ); for (let i=0, iMax= JSON_In[1].length; i<iMax; i+=2 ) { JSON_Out.push( [JSON_In[1][i], JSON_In[1][i+1] ] ); } console.log( JSON_Out );立即关闭很多程序,并及时列出批处理列表。

我想我会运行以下其中之一:

  • ps -ax(恰好在CMD列中显示)
  • lsof(仅显示进程名称)

然后,例如,使用grep sed awk或其他方法,我想要一个进程名称列表(在开始和结束处都带有引号),我可以手工杀死所有进程以进行批量关闭,使用xargs或从文本文件中插入

之前:示例

killall

之后:

2138 ttys003    0:00.29 ssh -Y root@cheese
 4594 ttys006    0:00.05 login -pf tom
 4685 ??         0:07.70 /Applications/Google Chrome.app/Contents/Versions/71.0.3578.98/Google Chrome Helper.app/Contents/MacOS/Google Chrome Helper --type=renderer
  771 ??        11:24.08 /Applications/Utilities/System Information.app/Contents/MacOS/System Information

每行都可以在killall中使用,例如:

杀死所有“系统信息”

类似的东西:

"ssh"
"login"
"Google Chrome Helper"
"System Information"

0 个答案:

没有答案
相关问题