简体   繁体   English

如何获取和杀死进程Mac终端

[英]How to get and kill the process Mac terminal

  1. Find specific client with name and memory查找具有名称和 memory 的特定客户
  2. Get the client pId获取客户端 pId
  3. Kill pId杀死 pId

Can I do kill that process just within the terminal.我可以在终端内终止该进程吗?

What I tried我试过的

ps aux | grep leagueClientUxHelper | awk '{print $2}'

but I can't get the large memory process.但我无法获得大型 memory 进程。

Same process names in activated status:处于激活状态的相同进程名称:

处于激活状态的相同进程名称

You can kill a process with the id by using the kill command.您可以使用 kill 命令终止具有 id 的进程。

ps aux | grep TextEdit | awk '{print $2}' | xargs kill

That will pipe it directly into the kill command.那将 pipe 直接放入kill命令中。 You will get an error because the ps aux will show two PIDs but it won't cause any problems.您将收到一个错误,因为 ps aux 将显示两个 PID,但不会导致任何问题。

Kill only works with PIDs Kill 仅适用于 PID

Are you trying to drill down to a certain memory length or compared to another instance like league1 memory is > leage2 memory?您是否试图深入到某个 memory 长度或与另一个实例(如 League1 memory 是 > leage2 memory)进行比较?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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