QueHow

A How-To and wiki Blog

  • Operating System
    • Windows
      • Windows 10
      • Windows 7
    • Linux
  • Software
    • Application Software
    • Microsoft Office
      • Outlook
      • Word
      • PowerPoint
  • Internet
    • Browsers
      • Mozilla Firefox
      • Google Chrome
    • CMS
    • Tips & Tricks
  • Website
    • ecommerce
    • Google
    • Social Networking
    • General Websites
  • Mobile
  • Email
    • Gmail
  • Wiki

How to Kill a Process in Ubuntu

By Neha T Leave a Comment

Do you sometimes feel annoyed due to the process getting hanged while working in the PC? Here’s the tutorial which will help you to know, how you can kill a process in Ubuntu. This is quite usual, for the processes getting slowed down due to the varied reasons, but however, this practice occurs rarely in the Linux environment such as Ubuntu, still there may be times when you may face this issue.

Now let me remind you what is a Process? A Process can be expressed as an object of a  program that is being executed. Each process has its unique Process Identification Number i.e. PID. In Linux like operating system, the very first process which gets initialized is “init” process.

The process is responsible for the execution of a task. Sometimes the process becomes unresponsive and at that time you are required to stop or kill that process. In Ubuntu, you can opt for “GUI mode” or the “Terminal” to kill a process.

Steps to Kill a Process in Ubuntu

Method 1 of 1:

To kill a process through GUI Mode:

Step 1: Firstly, you must set a shortcut to kill a process through a Graphical User Interface  (GUI).

At the top, you may see “settings” like symbol, click on it and then go to the “System Settings”.

How-to-Kill-a-Process-in-Ubuntu-step1

Step 2: Then select the “Keyboard”.

How-to-Kill-a-Process-in-Ubuntu-step2

Step 3: Here, you are required to click on the “Shortcuts” and then click on  “add” button signified as “+” over here.

How-to-Kill-a-Process-in-Ubuntu-step3

Step 4: Now you will be asked to name the Shortcut and in the Command section you have to  write: “gnome-system-monitor” which is the actual command for the System Monitor.

System  monitor is responsible for handling the processes in GUI mode. Click on “Apply” button.

How-to-Kill-a-Process-in-Ubuntu-step4

Step 5: Shortcut is disabled for the time being, so click on the screen where “Disabled” is written.

How-to-Kill-a-Process-in-Ubuntu-step5

Step 6: Once you place your cursor at “Disabled”, it will change to “New Accelerator” as  displayed in the figure below. Then hold on the keys which you wish to set as for the System Monitor  shortcut.

I have pressed Ctrl + Alt +Del which is similar to the default shortcut for the Task  Manager in Windows, so that I could remember it.

How-to-Kill-a-Process-in-Ubuntu-step6

Step 7: If this key is already assigned for some other task, then a dialog box will appear.  Here, if you are sure what you are doing, then click on “Reassign”. Otherwise, choose cancel  and set another combination of keys for the shortcut.

How-to-Kill-a-Process-in-Ubuntu-step7

Step 8: The Shortcut is now created as shown in the figure below.

How-to-Kill-a-Process-in-Ubuntu-step8

Step 9: You just need to press the keys simultaneously whichever assigned to open the “System Monitor”. The system monitor will open up in few seconds. You are free to kill any of the  process.

I have chosen “gedit”, right clicked on it and then selected the “Kill Process” option.

How-to-Kill-a-Process-in-Ubuntu-step9

Step 10: Warning window appears, if you are sure then press “Kill Process” button to kill that process.

How-to-Kill-a-Process-in-Ubuntu-step10

Step 11: The process which I had selected to kill is no more available in the System Monitor, as  you can see in the figure below.

How-to-Kill-a-Process-in-Ubuntu-step11

Method 2 of 2:

To Kill a Process using Terminal:

Step 1: To use “kill” command you must know the process ID, for that use the command  “pidof processname”.

For an example, I want to get the PID of Firefox, so I will type “pidof  firefox” and press enter as shown in the figure below.

How-to-Kill-a-Process-in-Ubuntu-step1

Step 2: As an output of aforementioned command, the PID will be displayed on your screen, which will be used further.

How-to-Kill-a-Process-in-Ubuntu-step2

Step 3: Now, it’s time to use “kill” command. Type “kill -9 4548” where 4548 is the process ID  and -9 is a signal to stop the process forcefully. You can use this command without “-9”. In the  background, you can see the Firefox icon that means Firefox is still running.

How-to-Kill-a-Process-in-Ubuntu-step3

Step 4: Once you press enter after writing kill command as discussed in the step 3, you will see that  Firefox is stopped and you can see that, the process is no longer running.

How-to-Kill-a-Process-in-Ubuntu-step4

Step 5: The other way to kill the process without using its PID and if you are not willing to write the full name of a process then you must go for “pkill” command. But before using it you should  check for the processes having the keyword which you want to kill.

For an example: I am  curious to delete the process having keyword “ged”. So, use “pgrep -l ged” that would return  the list of processes corresponding to its PID having the characters “ged”.

It should be kept in mind that these keyword must be in between first 15 characters of the process.

How-to-Kill-a-Process-in-Ubuntu-step5

Step 6: Here, you can see the process ID and its name, containing the keyword “ged”.

How-to-Kill-a-Process-in-Ubuntu-step6

Step 7: You are now free to use “pkill” command. Lets talk about using it: type “pkill ged”, you can use the keyword suitable for the process, that you want to kill.

How-to-Kill-a-Process-in-Ubuntu-step7

Step 8: Another command which you may use to kill the processes, is “xkill”.

The Xkill command pinches the X server to stop the clients running in your system.

How-to-Kill-a-Process-in-Ubuntu-step8

Step 9: After using the Xkill command when you press enter, a message will appear as “Select the window whose client you wish to kill with button 1” and the cursor will turn into the cross sign. With the help of this you can close or kill the process which is running at the same time.

How-to-Kill-a-Process-in-Ubuntu-step9

Step 10: Once you have completed the above mentioned operations, you may see a message on  the terminal window as shown.

How-to-Kill-a-Process-in-Ubuntu-step10

Step 11: Hey Guys, you can also use the “killall” command to kill the processes you wish. The major  advantage of this command is that you can kill the processes simultaneously having different PID’s but with the same  process name. “killkall” command terminates all the processes except the one which has generated the killall command. The killall comand can be used with various signals such as :

“killall -9 processname” : This command will kill all the process associated with the given  process name. Here, you don’t have to enter the PID.

“killall -“ : This command will send the SIGTERM signal i.e. 15, that signifies to wait for 30  seconds and after that it will send signal 9 i.e. SIGKILL signal to kill the process.

Now I will show you to how to check the options which can be used with killall command. Just type “killall” on the terminal window.

How-to-Kill-a-Process-in-Ubuntu-step11

Step 12: The Output corresponding to “kill” will display on your screen. Try the one you  want.

That’s it guys, keep checking the website for new updates regarding HOW TO…

How-to-Kill-a-Process-in-Ubuntu-step12

You Might Also Like:

how-to-show-running-process-in-ubuntuHow to Show Running Processes in Ubuntu how-to-install-true-type-fonts-in-ubuntuHow to Install TrueType Fonts in Ubuntu how-to-install-and-configure-apache-web-servers-in-ubuntuHow to Install and Configure Apache Web Server in Ubuntu how-to-install-google-chrome-and-customize-it-in-ubuntuHow to Install Google Chrome and Customize it in Ubuntu how-to-use-sed-command-in-ubuntuHow to Use SED Command in Ubuntu How to Check Ubuntu Kernel Version How we can Change the Directory in Ubuntu how to enable and disable firewall in ubuntuHow to Enable and Disable Firewall in Ubuntu

Leave a Reply Cancel reply

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

Most Viewed

  • How to Install and Use TELNET in Ubuntu
  • How to install Hindi fonts in MS Word
  • How to Change a File Extension in Windows 10?
  • How to create a flipkart account in 3 simple steps
  • How to Change Monitor Refresh Rate in Windows 10?
  • How to install IIS on Windows 10
  • How to Insert Clickable Checkbox in MS Word 2016?
  • How to Set Auto Reply in Outlook 2016?
  • How to Login as Administrator in Windows 10?
  • How to Check RAM Size and System Type in Windows 10?

Recent Additions

  • How to Add Hyperlink to Another Sheet in Excel?
  • How to Add and Remove Watermark in Excel
  • How to use Relative and Absolute Cell Reference in Excel?
  • How to Enable and Disable Scroll Lock in Excel?
  • How to Use INDEX and MATCH Functions in Excel?
  • How to Make Bar Graph in Excel?
  • How to Count Duplicate Values in Excel?
  • How to Wrap Text in Excel?
  • How to Round off Numbers in Excel?
  • How to Create a Bell Curve in Excel?

Related Searches

  • How to Password Protect an Excel file
  • How to Change Logon Screen in Windows 10?
  • How to open Registry editor in Windows 10
  • How to Export Contacts from Outlook 2010 to Excel
  • How to Print a PDF file

Copyright © 2023 · QueHow · Contact Us