gpt4 book ai didi

macos - 管道和 xargs => 顶部

转载 作者:行者123 更新时间:2023-12-02 22:04:51 30 4
gpt4 key购买 nike

<分区>

我正在尝试使用管道和 xargs 以特定 pid 启动 top,但我无法让它工作,我也不知道为什么:

ps aux|grep ProgramName|awk '{print $2}'|head -n1|xargs top -pid

如果我在 head -n1 之后停止,我会将正确的 pid 打印到屏幕上,并且手动将该 pid 添加到命令 top -pid XXX 也可以,但是运行整行作为一个命令只是不返回顶部屏幕。

我在这里做错了什么?

编辑:是的,“-pid”确实是正确的(进一步检查远程 shell 发现它实际上是基于 Mac OS 的系统,而不是 Linux 系统)

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com