alias kjava=‘ps -ef|grep ProcessName |awk "{print $2}"|xargs kill -9‘
上面脚本放在杀JAVA进程中,会出现一些错误警告提示,如果把 aux 改成 ef ,连同SecureCRT也会断开连接
杀死java 进程
ps -ef|grep java |grep -v grep|cut -c 9-15|xargs kill -9
编辑别名
alias kjava=‘ps -ef|grep java |grep -v grep|cut -c 9-15|xargs kill -9‘
永久生效
[[email protected] ~]# vim /root/.bashrc # .bashrc # User specific aliases and functions alias rm=‘rm -i‘ alias cp=‘cp -i‘ alias mv=‘mv -i‘ alias sjava=‘ps -aux|grep java‘ alias kjava=‘ps -ef|grep java |grep -v grep|cut -c 9-15|xargs kill -9‘ [root@pmserver ~]# source /root/.bashrc
原文地址:https://www.cnblogs.com/vipsoft/p/9757885.html
时间: 2024-09-30 05:27:03