Hacker News new | ask | show | jobs
by vbernat 3338 days ago
"args" could be replaced by "comm" to not filter grep. grep could be replaced by awk:

    ps -A -opid,comm | awk '($2 == "haproxy") {printf "%d ",$1}'
However, "pidof haproxy" would work too.