LINUX 101: How to use the kill and killall commands

Jack Wallen exhibits you the essential distinction between two instructions that finish with the identical outcomes … closing unresponsive functions.

linux penguin

Picture: Jack Wallen

It is a uncommon event {that a} Linux software will run astray, nevertheless it does occur. This most frequently occurs with user-facing apps, reminiscent of browsers, workplace suites and the like. When that occurs, what do you do? You flip to kill or killall, two instructions that offer you absolute management over whether or not an software can proceed working or not. 

SEE: 5 Linux server distributions you need to be utilizing (TechRepublic Premium)

When you discover an app has change into unresponsive, both kill or killall won’t ever fail to point out that app who’s boss: You. However which command do you have to use? 

To be trustworthy, I nearly all the time use killall. Why? As a result of with the killall command I haven’t got to fret about first discovering the PID of the working course of. And when you have to do away with a course of rapidly, nothing beats killall

The one caveat to utilizing killall is that you must know the true title of the method. As an example, you could not simply difficulty the command killall libreoffice, as a result of the command used to launch the instrument may be soffice.bin. 

So, there’s the trick with utilizing killall. You could know the title of the particular command and never the applying. For that, I would launch high to see which apps are working, because it’ll listing them by command title. 

I might cease LibreOffice with the killall soffice.bin command. 

With the kill command, you kill by means of the method ID, so that you’d first want to make use of a instrument like high to search out the PID. With the PID in hand, you can kill LibreOffice with a command like kill 279329

The necessary factor to recollect is the killall requires the precise command title of the app you wish to power shut, and kill requires the method ID of the applying. Between these two instructions, you’ve gotten all the facility at your fingertips to finish wayward functions.

Additionally see

Recent Articles


Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here

Stay on op - Ge the daily news in your inbox