cqutwangyu
#!/bin/bash -ile
echo port $1

pid=`netstat -anp|grep $1.*:::.*java|awk -F \' \' \'{print $7}\'|awk -F \'/\' \'{print $1}\'`
echo pid $pid

flag=\'user.dir\'
dir=`jinfo $pid|grep $flag|awk -F \' \' \'{print $3}\'`
echo $dir

cd $dir
echo `ls`
View Code

脚本保存为findPortInfo.sh

chmod +x findPortInfo.sh赋予执行权限

使用方式:./findPortInfo.sh 8080

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-06-19
  • 2021-11-18
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-18
  • 2022-01-24
  • 2021-11-16
  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案