批量杀进程

ps -ef|grep something_to_grep|grep -v grep|cut -c -|xargs kill -

“grep -v grep”是在列出的进程中去除含有关键字“grep”的进程。

“cut -c 9-15”是截取输入行的第9个字符到第15个字符,而这正好是进程号PID,也有使用awk。

awk '{print $2}':取上一步输出的第二个域,即PID

ps -ef|grep something_to_grep|grep -v grep|awk '{print $2}'|xargs kill -

批量杀死多个进程 linux kill的更多相关文章

  1. shell命令批量杀死MySQL连接进程

    (1)将全部的MySQL连接进程杀掉 for i in `mysql -uroot -pzhangyun -Bse "show processlist" | grep -v &qu ...

  2. linux - awk 和kill 批量杀死进程

    ps -ef|grep check_os.sh | grep -v grep | awk '{print $2}' | xargs kill -9 $2表示第2列,即进程号PID; grep -v g ...

  3. Linux中使用ps、awk、sh一起批量杀死所有的dotnet进程。

    一.操作 Linux中使用ps.awk.sh一起批量杀死所有的dotnet进程. 二.参考命令 ps -ef|grep dotnet|awk 'NR==2{print "kill " ...

  4. Linux批量杀死进程

    杀死进程在linux中使用kill命令了,我们可以下面来给各位介绍一篇关于Linux下批量杀死进程的例子,希望此例子可以对各位同学带来帮助的哦. 批量杀死包含关键字“php-fpm”的进程. kill ...

  5. Linux批量杀死包括某个keyword的进程

    ps -ef|grep ./amplxe-gui|grep -v grep|cut -c 9-15|xargs kill -9 批量杀死包括keyword"./amplxe-gui" ...

  6. mysql查看和设置timeout 和批量杀死链接进程

    查看的语句 show global variables like "%timeout%"; 结果: +-----------------------------+--------- ...

  7. Linux下禁止使用swap及防止OOM机制导致进程被kill掉

    首先解释两个概念: swap:在linux里面,当物理内存不够用了,而又有新的程序请求分配内存,那么linux就会选择将其他程序暂时不用的数据交换到物理磁盘上(swap out),等程序要用的时候再读 ...

  8. 杀死进程命令 kill

    一般kill命令和ps命令结合使用, 例:现在想杀死telnet的进程 1.在所有进程中查看telnet命令 ps -ef |grep telnet 2.根据上面命令查到的进程id,如pid 是 xx ...

  9. Linux下查找进程,kill进程

    1. ps命令用来查找linux运行的进程,常用命令: ps aux | grep 进程名:  eg:ps aux | grep admin 查找admin的进程 或者 ps -ef | grep j ...

随机推荐

  1. Sequentially-consistent ordering

    先引入cppreference中的描述: Atomic operations tagged memory_order_seq_cst not only order memory the same wa ...

  2. 1136 A Delayed Palindrome (20 分)

    Consider a positive integer N written in standard notation with k+1 digits a​i​​ as a​k​​⋯a​1​​a​0​​ ...

  3. 视角同步NewViewTarget

    SetViewTargetwithBlen说明: http://api.unrealengine.com/INT/BlueprintAPI/Game/Player/SetViewTargetwithB ...

  4. failed to launch: nice -n 0 /home/hadoop/spark-2.3.3-bin-hadoop2.7/bin/spark-class org.apache.spark.deploy.worker.Worker --webui-port 8081 spark://namenode1:7077

    spark2.3.3安装完成之后启动报错: [hadoop@namenode1 sbin]$ ./start-all.shstarting org.apache.spark.deploy.master ...

  5. 插件开发-滑条(slide)开发

    自己一直很喜欢开发组件,只是OPP学的不是很精,自己在项目中用别人的框架进行项目开发,难免受制于人,也许这就是个人实际项目需求和框架提供的多少有点不符,引导我自己尝试开发一些自己常用的组件,话不多说, ...

  6. Webbrowser指定IE内核版本(更改注册表)

    如果电脑上安装了IE8或者之后版本的IE浏览器,Webbrowser控件会使用IE7兼容模式来显示网页内容.解决方法是在注册表中为你的进程指定引用IE的版本号. 比如我的程序叫做a.exe 对于32位 ...

  7. (转)CLR20R3 程序终止的几种解决方案

    原文地址:https://blog.csdn.net/fxfeixue/article/details/4466899 这是因为.NET Framework 1.0 和 1.1 这两个版本对许多未处理 ...

  8. Html——拖放

    设置元素为可拖放 首先,为了使元素可拖动,把 draggable 属性设置为 true : <img draggable="true" /> 拖动什么 - ondrag ...

  9. 《Linux 性能及调优指南》3.1 确认瓶颈

    翻译:飞哥 ( http://hi.baidu.com/imlidapeng ) 版权所有,尊重他人劳动成果,转载时请注明作者和原始出处及本声明. 原文名称:<Linux Performance ...

  10. WPF Combobox选中事件

    /// <summary> /// 选中事件 /// </summary> /// <param name="sender"></para ...