How to Kill All Python Processes in Ubuntu

Written by kristen waters
  • Share
  • Tweet
  • Share
  • Email

When you are running multiple instances of Python, it can be difficult to find all of the instances to stop them. In the Ubuntu Linux operating system, each instance of an application or process has a unique ID. You can stop all instances of a particular process, such as Python, without knowing the ID of each process by using the "pkill" command, which locates all of the processes that match the criteria given and kills each one. The "pgrep" command will output the process IDs based on the criteria given.

Skill level:

Other People Are Reading


  1. 1

    Right-click on the desktop and choose the "Terminal" option to open a terminal window.

  2. 2

    Type the command "sudo pkill python" to kill all of the Python processes running, regardless of the user who started the process.

  3. 3

    Type your password when prompted.

  4. 4

    Type the command "sudo pgrep python" to ensure that all Python processes have been stopped. There should be no output for this command, and you will not be prompted for a password.

Don't Miss


  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.