check the running process by its name code example
Example 1: bash check if process is running by name
if pgrep -x "<PROCESS_NAME>" > /dev/null; then
echo "Running"
else
echo "Not running"
fi
Example 2: how to get process id in linux
lsof -i tcp:3000
kill -9 pId