`
li370604005
  • 浏览: 45847 次
  • 性别: Icon_minigender_1
  • 来自: 盐城
社区版块
存档分类
最新评论

Linux查找文件,查找程序端口并杀死程序

阅读更多

Linux当中查找文件使用命令:

find path -name *xxxx*

// path 代表搜索的路径

//-name 表示按名称来搜索

//** 使用统配符来概括文件名 xxxx 为文件名 

例如:find ./ -name  *test*;

表示在当前目录下找到包含test的文件。

 

Linux 中查找 进程 ; 端口 ; 

ps -ef | grep tomcat 进程

ps -ef | grep tomcat 端口 

netstat -a  监听与未监听的地址+端口

 

杀死进程

当在某种需要根据进程名删除进程时使用代码如下:

 

kill -9 $(ps -ef|grep 删除包含进程名|gawk '$0 !~/grep/ {print $2}' |tr -s '\n' ' ')

替换蓝字即可。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics