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


Possibly Related Articles

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.

Introduction to Adobe AIR (NetTuts)

Nettuts have a nice Introduction to Adobe AIR which focus on using HTML/JS to build an AIR Application. It covers -- Adobe AIR Architecture, How to install AIR, Get the development SDK, Configurations, gets on to ...2nd Oct, 2008

Decide Team Type from Books

What do you think of the "Team-Type" if they got these books recently? What "Team-Type" do these books suggest? ( surveys) 29th Sep, 2008

What do investors look for in a startup?

A great video Interview with Venture Hacker Naval Ravikant answering the age-old question: What do you look for in a startup? Investors look for two things that are paramount above all: # Great team: It's obvious. It's a ...27th Sep, 2008

You don't mess with the 'Englineer Bother'

(Via: Hiring Horror) 24th Sep, 2008

Dear Adobe

Do you have a gripe with the Adobe Softwares that you use? Do you have complaints about Adobe Softwares? Please visit Dear Adobe to file your informal gripe with Adobe. 15th Sep, 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.
  • o! Just Me Of colorful cultures, entertainment, media, life hacks, music, books and movies from hollywood & bollywood.
  • oCricket oCricket is about Cricket and people enthusiastic about it.
  • ActionScript 3.0 Reference Flash/Flex ActionScript 3.0 Reference.
  • AS 2.0 Reference Reference for ActionScript 2.0 Programming Language used in Flash. Primarily stashed here for my own personal reference.
  • Forum Oinam’s technical discussion forum where developers and designers can discuss all technical topics.
  • My Special Job My Special Job is a place where you can look for your weird necessities, strangely superb employees, when your need are more of those hackers, geeks, and ultimate rockstars in the Internet Technology.

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 Personal Identity Portal powered by VeriSign Labs

Brajeshwar's affinity with Adobe

My Photos

More photos on Flickr

Member of 9rules Network

Since its inception on 11th June, 2001, "Brajeshwar" has 863 Articles and 5,995 comments, contained within 20 categories and 1,233 tags.