There're two ways to do this:
Use the following command to end the running process.
When the process is running as background process, use the
ps command to find the process ID then use the PID to kill the process.
ps -ef | grep "ng serve"
The output will look like this:
501 25782 23667 0 5:04PM ttys000 0:22.54 ng serve 501 25790 23408 0 5:05PM ttys001 0:00.01 grep ng serve
Then use this command to stop ng serve.