How to Terminate a process in CLI

Sign up to my newsletter for more tutorials!.

If there’s a program that isn’t responding, you may manually terminate this system by utilizing the kill command. This command will ship a selected sign to the unresponsive software and instruct the applying to terminate itself.

There are forty-six indicators in whole that you should utilize, however typically these two indicators are used:

  • SIGTERM (15) — prompts a program to cease working and provides it a while to avoid wasting its state. If you don’t specify the sign when coming into the kill command, this can be used.

  • SIGKILL (9) — forcibly terminates course of instantly. You lose the unsaved state.

Aside from figuring out the indicators, you additionally must know the method identification quantity (PID) of this system you wish to terminate. In the event you have no idea the PID, run the ps ux command.

Be aware: To look straight for a course of, you should utilize grep: ps ux | grep <course of identify>

After ensuring you already know which sign to make use of and the PID of this system, enter the next syntax:

kill -<sign> <PID>
Enter fullscreen mode

Exit fullscreen mode

Add a Comment

Your email address will not be published. Required fields are marked *