Killing processes in batches

Source: Internet
Author: User
Killing processes in batches is a must. sometimes, thousands of processes may come out on linux servers. we can see them through the ps command and make statistics, but it is still difficult to kill them. Old method: ps-ef | grepprocess_name | wc-lps-ef | grepprocess_na... killing processes in batches is a must. sometimes, thousands of processes may come out on linux servers. we can see them through the ps command and make statistics, but it is still difficult to kill them. Old method: ps-ef | grep process_name | wc-lps-ef | grep process_name> 123.txtbeibeibei123.txt content to the Ultraedit software, which is organized into thousands of lines of commands similar to the following format, then copy it to the command line for execution, which is a little effort-consuming. Kill-9 123 kill-9 234 the new method: it feels good. a single command is done, which fully demonstrates the importance of shell tools such as awk for dba! Kill-9 $ (ps-ef | grep process_name | grep-v grep | awk '{print $2: awk '{print $2}' prints the second line of content. to display the first line of content, use $1. Grep-v grep remove all row records containing the grep word ps-ef | grep process_name show all row records containing the process_name word, process_name is the name of the process or other script you want to find.
 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.