pidof

Get the ID of a process using its name. More information: https://manned.org/pidof.

pidof bash

pidof -s bash

pidof -x script.py

kill $(pidof name)