WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : How to kill a list of PID's with one operation
Categories : Linux
Boaz Yahav
Date : Aug 28th 2000
Grade : 2 of 5 (graded 5 times)
Viewed : 15961
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Boaz Yahav
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 


Step 1
=====

If you do ps auxww on a Linux machine you will get a list of all of the processes running on
that machine at the specific time :

ps auxww


Step 2
=====

Now, you need to decide which processes you wish to kill. you can do that with the help of
the grep function :

ps auxww | grep MyString

Where MyString is any string you wish to search for.


Step 3
=====

To get only the PID columns from the output we use the AWK program like this :

ps auxww | grep php | awk '{print $2}'

This will return the 2nd ($2) column from the output of the grep and ps functions.


Step 4
=====

This is the final kill :)
Add the kill command at the beginning and wrap the rest with ` ` :

kill `ps auxww | grep php | awk '{print $2}'`

This should do it.

berber



PHP / FTP Web Authentication Scrip! Please visit WWW.FLACCESS.COM
Categories : Apache, Ecommerce, FTP, Linux, Sockets
UDMSearch - a free search engine, indexing system.
Categories : Search Engines, Linux, PHP, MySQL, ODBC
Add a linux user from php
Categories : Linux, PHP
Easily Grant Temporary SSH Access to yourself when in remote location
Categories : PHP, Linux, Cron, Security
ElfReader: An ELF (Executable and Linking Format) header information in PHP. Shows how to use the UNPACK function to read data.
Categories : PHP, Linux, PHP Classes
PHPBrowser - browsing linux file systems.
Categories : PHP, Linux, Filesystem
Process killer for *nix
Categories : PHP, CGI, Shell Scripting, Linux
How to set the date on a Linux machine.
Categories : Linux