The ‘end task’ procedure for Linux

More than an operating system Linux is a large community and strong relationship between its members. A relationship of sharing knowledge and reusing it, unlike reinventing the wheel!

Managing tasks

Illustration by Blakeemrys

Managing TasksOne thing you’ll always wish to know about.

In our previous article — Sharpen your Linux vocabulary — we visualized few commonly used terms in context with the Linux operating system and its surroundings! I thank and appreciate the readers for adding on a few more words.

While I was figuring out a way to run Internet using a CDMA wireless modem on my Linux machine, one of the applications refused to respond due to some rare error. This very incident reminded me to come up with following article which elaborates few methods to help you terminate a process or application running on a Linux distribution - something similar to ‘end task’ on a windows operating system.

Remember, there is no Ctrl+Alt+Del key combination on Linux - by default!

Let us now see some of the interesting ways to kill those stuck and stubborn processes. A very mundane and primitive way is to use the command ps aux, look through the process list until you find the PID (process ID) you want and issue the kill command.

Alternatively, a better way is to use the ‘killall’ command which would automatically kill a program based on its name.

# killall mozilla-bin

There may be times when you shall only know a part of the name. In such a scenario, you can combine ps with grep, kill and awk to produce something like this.

# ps aux | grep mozilla | awk '{print $2}' | xargs kill

Now if that was tedious, there are still simpler ways. Enter pkill and the closely related pgrep. All these commands are part of the sys-apps/procps package and are specifically designed to search for or kill running processes. The previous command could be replaced with the following:

# pkill mozilla

If you just need to list the PID’s instead of killing them, you may just use pgrep.

Lastly, if you have a runaway process hogging /dev/dsp, or some other file or socket, you can use fuser, which displays the PID’s of process using a specified file or filesystem. You can give it the -k option and can easily kill those processes:

# fuser -k /dev/dsp

Now with the power of these commands, you shall never have the problem of ’killing’ or stopping a process which you are unable to do otherwise.

Remember a fact that Linux has a lot of features which may not be evident by default or on the first look. But the depth it has considering the underlying architecture and a strong command line integration is simply superb. I would advise you to look out for a few HOW-TO’s, hang around in the IRC’s and participate in the discussions at various Linux forums - either as an audience or a contributor.

More than an operating system Linux is a large community and strong relationship between its members. A relationship of sharing knowledge and reusing it, unlike reinventing the wheel!

Praval, the author of this article is available as a freelance writer and technology blogger. He writes reviews and stuffs related to Wordpress, Linux, Information marketing, Open Source Softwares, Life hacks and technology in general. He also provides information marketing solutions to his clients. You may reach him at Praval.com


Don't like it? There are lots of published articles, pick a random one.

oCricket

Praval Singh posted this article on Thu, Jun 26th, 2008 at 5:45 am
Categorized under Featured, Linux and has the following tags

Prev Article: Java Servlets, an introduction

Next Article: Enjoy the Adobe MAX 2008 Experience

Archives: Visit the Archives for more articles.

Comments Post Yours

There are one response so far. You can follow any responses to this entry through the RSS feed. You can leave a response, or trackback from your own site.

  1. Or, Just press Ctrl + Esc and launch the Task Manager (if you’re using KDE that is, I don’t know about GNOME).

Post yours

Sidenotes

Quick notes, scribbles, somehow related to this website and to what I do. Or perhaps I'm just plain lazy to make them into a full article.

Great Indian Developer Summit 2009

I got a Press Release of the upcoming GIDS '09 and here is an excerpt. The summit's program covers Java, REST, Unit testing, Groovy, Spring, Struts 2.0, SOA, Cloud Computing, Web Services, JRuby, RoR, Ruby, JVM, ...21st Jan, 2009

The flourishing gun market in Pakistan

VICE Travel: Darra, Pakistanby Top-Notch112 (Via: Deep Green Crystals) 20th Jan, 2009

Angry Ringtone for iPhone and others

[audio:http://audio.brajeshwar.com/angry-ring-ring.mp3] The ANGRY RINGTONE for iPhone. (Click the PLAY button above!) Download * iPhone Ringtone (.m4r) * MP3 Ringtone (.mp3) * Zipped (both .m4r and .mp3) To use it as an iPhone Ringtone; just double click the file "angry-ring-ring.m4r" and it ...15th Jan, 2009

IIM Ahmedabad's Leverage 2009

Leverage, the Venture Capital and Private Equity Club of IIM Ahmedabad and the Centre for Innovation Incubation and Entrepreneurship bring to you the 1st edition of the Venture Capital and Private Equity Conference on the ...12th Jan, 2009

Fedora 10 Released

Let's talk history! Fedora was created in late 2003 as a Linux based Operating System which gives the users an admittance from anywhere in the world to the most up-to-date free and open source software ...28th Nov, 2008

View the Sidenotes Archive

Play the Penguin Game

Recommended

  • Not Safe for Work Ever clicked a link and felt embarrassed with the content in front of your co-workers? Ever caught unaware because the funny link your friend sent was a little beyond funny? Let’s minimize that with NSWF.
  • oCricket oCricket is about Cricket and people enthusiastic about it.
  • ActionScript 3.0 Reference Flash/Flex ActionScript 3.0 Reference.
  • Forum Oinam’s technical discussion forum where developers and designers can discuss all technical topics.
  • AS 2.0 Reference Reference for ActionScript 2.0 Programming Language used in Flash. Primarily stashed here for my own personal reference.
  • Downloads All downloads, Free and Open Source.
  • Ode to Apple Dedicated to Apple - Mac, iPhone, iPod, iTunes, Quicktime, Apple TV and all the awesome softwares for the Apple Mac.

Download free Brajeshwar Wordpress Theme

Brajeshwar

Brajeshwar I firmly believe in keeping things simple, easy for users and I envison pushing the technical envelop time and again for the betterment of viable commercial and practical applications. More about me.

Brajeshwar's affinity with Adobe

My Photos

More photos on Flickr

Member of 9rules Network

Since its inception on 11th June, 2001, "Brajeshwar" has 949 Articles and 6,478 comments, contained within 22 categories and 1,497 tags.