Have you ever found yourself doing this:
ps aux | grep [b]eamAnd then copying the pids one by one so you can pass them to kill?
There's a better way to return just the pids of the process you care about and not having to worry about ps finding your grep call (that's why I'm surrounding the b in beam with square brackets).
pgrep -f beamThis will return just the pids, one in each line (which is perfect for use with xargs)
Example output:
11632
11456Use with xargs to kill (-9 for extra brutality points 😈):
pgrep -f beam | kill -9