linux stop running script

C++
ps
kill [pid]

// if the above does not work
kill -9 [pid]
Source

Also in C++: