WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
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 Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
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
Submit Site
Forex Trading Online forex trading platform

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 4 times)
Viewed : 3763
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 
 


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



UDMSearch - a free search engine, indexing system.
Categories : Search Engines, Linux, PHP, MySQL, ODBC
Easily Grant Temporary SSH Access to yourself when in remote location
Categories : PHP, Linux, Cron, Security
How to set the date on a Linux machine.
Categories : Linux
Free PHP script for Fetching contacts from Yahoo, Gmail and Lycos
Categories : PHP, Apache, Linux, Web Applications, Email
Process killer for *nix
Categories : PHP, CGI, Shell Scripting, Linux
PHP / FTP Web Authentication Scrip! Please visit WWW.FLACCESS.COM
Categories : Apache, Ecommerce, FTP, Linux, Sockets
PHPBrowser - browsing linux file systems.
Categories : PHP, Linux, Filesystem
Add a linux user from php
Categories : Linux, PHP
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