LINUX 101: How to use the kill and killall commands

3 years ago 386

Jack Wallen shows you the basal quality betwixt 2 commands that extremity with the aforesaid results ... closing unresponsive applications.

linux penguin

Image: Jack Wallen

It's a uncommon juncture that a Linux exertion volition tally astray, but it does happen. This astir often happens with user-facing apps, specified arsenic browsers, bureau suites and the like. When that happens, what bash you do? You crook to kill oregon killall, 2 commands that springiness you implicit power implicit whether an exertion tin proceed moving oregon not. 

SEE: 5 Linux server distributions you should beryllium using (TechRepublic Premium)

If you find an app has go unresponsive, either kill oregon killall volition ne'er neglect to amusement that app who's boss: You. But which bid should you use? 

To beryllium honest, I astir ever usage killall. Why? Because with the killall bid I don't person to interest astir archetypal uncovering the PID of the moving process. And erstwhile you request to get escaped of a process quickly, thing beats killall

The lone caveat to utilizing killall is that you person to cognize the existent sanction of the process. For instance, you couldn't conscionable contented the bid killall libreoffice, due to the fact that the bid utilized to motorboat the instrumentality mightiness beryllium soffice.bin. 

So, there's the instrumentality with utilizing killall. You request to cognize the sanction of the existent bid and not the application. For that, I mightiness motorboat top to spot which apps are running, arsenic it'll database them by bid name. 

I could halt LibreOffice with the killall soffice.bin command. 

With the kill command, you termination by mode of the process ID, truthful you'd archetypal request to usage a instrumentality similar top to find the PID. With the PID successful hand, you could termination LibreOffice with a bid similar kill 279329

The important happening to retrieve is the killall requires the existent bid sanction of the app you privation to unit close, and kill requires the process ID of the application. Between these 2 commands, you person each the powerfulness astatine your fingertips to extremity wayward applications.

Open Source Weekly Newsletter

You don't privation to miss our tips, tutorials, and commentary connected the Linux OS and unfastened root applications. Delivered Tuesdays

Sign up today

Also see

Read Entire Article