The article directories

  • 1. Stop processes kill and killall
    • 1.1 introduction
    • 1.2 Basic Syntax
    • 1.3 Common Options
    • 1.4 Best Practices

1. Stop processes kill and killall

1.1 introduction

If a process needs to be stopped halfway through execution, or if a large amount of system resources have been consumed, you can consider stopping the process. Use the kill command to complete the task.

1.2 Basic Syntax

Killall Process name killall Process name killall Process name killall Process name killall Process name killall Process name killall Process name killall Process name killall Process name killall Process name killall Process name killall Process name

1.3 Common Options

-9: Forces the process to stop immediately

1.4 Best Practices

  1. Case 1: Delete an unauthorized user

    Kill the process,, such as:kill 11421
  2. Case 2: Terminate the remote login servicesshd, kill Process ID corresponding to SSHD;



    Restart again in due coursesshdservice
/bin/systemctl start sshd.service
Copy the code

  1. Case 3: Terminate multiplegedit(text editor process), demokillall gedit

  2. Case 4: Forcibly kill a terminal, instructionKill -9 Indicates the PROCESS PID