如何使用ps在BusyBox中grep进程



当我尝试运行ps -ef|grep process命令时,jenkins管道中出现以下错误:

ps: unrecognized option: p
BusyBox v1.27.2 (2017-12-12 10:41:50 GMT) multi-call binary.
Usage: ps [-o COL1,COL2=HEADER]
Show list of processes
-o COL1,COL2=HEADER Select columns for displayI have Jenkins version 2.135 and

我有BusyBox v1.27.2

有人能告诉我在不安装alpine image的情况下,如何避免ps -ef|grep process出现此错误吗

您可以使用

docker exec -it container_name ps -ef | grep process 

或者您可以通过运行docker exec -it container_name /bin/bash对容器执行ps -ef | grep process

最新更新