Linux batch delete process

Source: Internet
Author: User
In linux, multiple Kill processes are often required to delete processes in batches. if these processes share common characteristics, you can Kill them with a command. For example, clear all remote connection processes of the Oracle Database: www.2cto. comps-efww | grepLOCALNO | grep-vgrep | cut... in linux, multiple Kill processes are often required to delete processes in batches. if these processes share 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 of "grep LOCAL = NO" is that all processes with the keyword "LOCAL = NO" are common features of the remote connection process in Oracle databases. "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 it. Sometimes there are a lot of processes found, all of which are dozens of columns. you can use aw matching printing and xargs kill-9 to kill them in batches at a time.
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.