In linux, processes with specified file names are killed in batches.

Source: Internet
Author: User
In linux, a process containing the specified file name is killed in batches. I am a database administrator (DBA) working in RedHat7.0 ). It is often necessary to Kill multiple processes at work. if these processes have common characteristics, you can Kill them with a command. For example, clear all remote Oracle databases... linux to batch kill processes containing the specified file name. I am a database administrator (DBA) working under Red Hat 7.0 ). It is often necessary to Kill multiple processes at work. if these processes have common characteristics, you can Kill them with a command. For example, clear all remote connection processes of the Oracle database: www.2cto.com ps-efww | grep LOCAL = NO | grep-v grep | cut-c 9-15 | xargs kill-9 pipe operator "|" is used to separate two commands, the output of the command on the left of the pipeline operator serves as the input of the command on the right of the pipeline operator. The following are several commands that are connected with pipeline characters: "ps-efww" is the command for viewing all processes in Red Hat 7.0. The retrieved process serves as the input of the next command "grep LOCAL = NO. The output result of "grep LOCAL = NO" is that all [size = x-small] [/size] processes with the keyword "LOCAL = NO, this is a common feature of the remote connection process in Oracle databases. Www.2cto.com "grep-v grep" is a process that removes the keyword "grep" from the listed processes. "Cut-c 9-15" refers to intercepting 9th to 15th characters of the input line, which is exactly the process id PID. The xargs command in "xargs kill-9" is used to take the output result (PID) of the preceding command as the parameter of the "kill-9" command and execute the command. "Kill-9" will forcibly kill the specified process, so that all remote connection processes in oracle are successfully cleared. For other similar tasks, you only need to modify the keyword section in "grep LOCAL = NO.
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.