DEV Community

Tanatip Siriprathum
Tanatip Siriprathum

Posted on

How to stop Angular ng serve on Mac/Linux

There're two ways to do this:

First
Use the following command to end the running process.

ctrl + c

Second
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"
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Then use this command to stop ng serve.

kill 25782
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
thorstenhirsch profile image
Thorsten Hirsch

Ouch. No need for such a brutal death (SIGKILL). Just give the process a chance to end his life with a smooth SIGTERM:

kill 25782
Enter fullscreen mode Exit fullscreen mode
Collapse
 
tanatip profile image
Tanatip Siriprathum

Thanks :)