LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-22-2003, 09:50 PM   #1
julianop
LQ Newbie
 
Registered: Dec 2003
Location: Minneapolis, MN
Distribution: Suse 10.2
Posts: 6

Rep: Reputation: 0
one-line kill command using process name


What's a one-liner that will kill a process by giving the name, instead of the PID?
I know I can get the pid and then kill that, but I want to do it in one line.

Thanks.
 
Old 12-22-2003, 09:51 PM   #2
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
You could use:
pkill procname
 
Old 12-22-2003, 10:03 PM   #3
julianop
LQ Newbie
 
Registered: Dec 2003
Location: Minneapolis, MN
Distribution: Suse 10.2
Posts: 6

Original Poster
Rep: Reputation: 0
I knew it would be that easy, and that I would embarrass myself

Thanks.
 
Old 12-22-2003, 10:14 PM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Another option might be:
killall processname

Cool
 
Old 12-22-2003, 11:28 PM   #5
julianop
LQ Newbie
 
Registered: Dec 2003
Location: Minneapolis, MN
Distribution: Suse 10.2
Posts: 6

Original Poster
Rep: Reputation: 0
Yes. Actually I just figured that one out because I realized I would need to kill multiple instances.

Cheers.
 
Old 12-22-2003, 11:37 PM   #6
julianop
LQ Newbie
 
Registered: Dec 2003
Location: Minneapolis, MN
Distribution: Suse 10.2
Posts: 6

Original Poster
Rep: Reputation: 0
OK,
Here's another one for you ...
How do I stop repeat instances of the same command line from filling up bash's history?
Back in my DOS days I used 4DOS, which was smart that way. Can I do this in Linux/bash?

j.
 
Old 12-23-2003, 12:33 AM   #7
julianop
LQ Newbie
 
Registered: Dec 2003
Location: Minneapolis, MN
Distribution: Suse 10.2
Posts: 6

Original Poster
Rep: Reputation: 0
never mind: it's HISTCONTROL=ignoredups
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to kill an idle user via the command line? goemon Linux - General 7 12-01-2005 07:01 PM
Please dont kill me for asking.. Command line? (I AM i n00b) Nox_hand Linux - Newbie 17 09-17-2005 04:59 PM
How can I see what process are running and how to I kill them? (command line). brynjarh Linux - Newbie 4 07-07-2004 04:01 PM
kill program command line demmylls Linux - General 7 02-09-2004 09:55 PM
Kill a process by command ITJedi Programming 3 03-07-2003 11:49 AM


All times are GMT -5. The time now is 06:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration