In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how shell kills a process with a specified process name". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how shell kills a process with a specified process name.
Ps-efww | grep-w 'node' | grep-v grep | cut-c 9-15 | xargs kill-9
Description: the pipe character "|" is used to separate two commands, and the output of the command on the left side of the pipe character will be used as the input of the command on the right side of the pipe character.
"ps-efww" is a command to view all processes. At this time, the retrieved process will be used as input to the next command "grep". Note that when you want to end other programs, replace the helloworld in the above command with another program name, and-w 'helloworld' forces PATTERN to match only the exact words.
"grep-v grep" is a process that removes the keyword "grep" from the listed processes.
"cut-c 9-15" intercepts the 9th to 15th characters of the input line, and this happens to be the process number PID.
The xargs command in "xargs kill-9" is used to take the output of the previous command (PID) as an argument to the "kill-9" command and execute the command.
"kill-9" forcibly kills the specified process, thus successfully purging the process with the same name.
At this point, I believe you have a deeper understanding of "how shell kills a process with a specified process name". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.