LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 05-07-2007, 05:02 AM   #1
turalo
Member
 
Registered: Sep 2005
Location: NL
Distribution: linux, windows,
Posts: 115

Rep: Reputation: 19
Question Need help with 1 line job


Hi guys, I need help creating one simple command,

what I want to do is kill all httpd procceses at once,
so if I do "ps -ef|grep httpd" I get 5 or 6 httpd proccesses

I want to kill them all, so all other processes stay, only httpd goes away, normaly if you do one by one you can use the pid , but I want to do it in one command.
like for example :
"ps -ef|grep httpd|kill -9 httpd but this does not works"

Please help.
 
Old 05-07-2007, 05:11 AM   #2
nichu
LQ Newbie
 
Registered: Sep 2006
Posts: 11

Rep: Reputation: 0
hi
maybe try to do this with pidof command
it lists every pid of process
or You can try killall command

Regards

Last edited by nichu; 05-07-2007 at 05:14 AM.
 
Old 05-07-2007, 05:29 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

@turalo: Please do not crosspost.

Answer is in the other thread.
 
Old 05-07-2007, 07:55 AM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash shell script read file line by line. Darren[UoW] Programming 57 04-17-2016 06:07 PM
C++ text file line by line/each line to string/array Dimitris Programming 15 03-11-2008 08:22 AM
php - Read file line by line and change a specific line. anrea Programming 2 01-28-2007 01:43 PM
linux scripting help needed read from file line by line exc commands each line read atokad Programming 4 12-26-2003 10:24 PM
PLEASE HELP... My Job Is On The Line mikey_man380 Linux - General 5 07-13-2003 12:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:26 PM.

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
Open Source Consulting | Domain Registration