Kill the same process name

Source: Internet
Author: User

Kill the same process name

Ps-efww|grep mtp-v2.0-sss-14d75424ba81113.conf |grep-v grep|cut-c 9-15|xargs kill-9

Description: Pipe symbol "|" Used to separate two commands, the output from the left command of the pipe character is entered as the command to the right of the pipe.

"Ps-efww" is a command to view all processes. At this point the retrieved process will be the input to the next command "grep", and note that to end other programs, replace Vim in the above command with another program name.

Grep-v grep removes the process that contains the keyword "grep" in the listed process.

"Cut-c 9-15" is the 9th character to the 15th character of the input line, which is exactly the process number PID.

The Xargs command in "Xargs kill-9" is used to take the output (PID) of the preceding command as a parameter to the "kill-9" command and execute the command.

The "kill-9" will forcibly kill the specified process, which successfully clears the process with the same name.


Kill the same process name

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.