美文网首页
Linux 常用命令

Linux 常用命令

作者: 陽_young | 来源:发表于2018-08-15 12:02 被阅读9次

    1.查看端口号

    netstat -tnlp
    netstat -anp|grep port
    ps -ef|grep java
    ps -ef|grep firewall
    //查找占用
    netstat -aon | findstr "5037"
    //查看占用pid的进程名称
    tasklist | findstr "6128"
    //查看进程堆栈
    jmap -dump:live,format=b,file=heap.dmp 5699
    jmap -dump:format=b,file=201709251725 5699

    2.杀死进程

    taskkill /f /t /javaw.exe
    kill -9 "1234"

    3.运行jar

    java -jar shop-product-XXX.jar

    //添加输出日志路径
    nohup java -jar shop-product-XXX.jar >console.log&

    //环境配置及添加输出日志路径
    nohup java -jar shop-product-XXX.jar --spring.profiles.active=test >console.log &
    nohup java -jarshop-product-XXX.jar --spring.profiles.active=pro>console.log &

    //分配内存环境配置及添加输出日志路径
    nohup java -jar -Xms6144m -Xmx6144m -Xmn1536m shop-product-XXX.jar --spring.profiles.active=pro>console.log&

    //查看日志文件
    tail -f console.log

    4.screen 创建session

    如screen -S shop-product
    screen -ls 查看当前活跃session
    ctrl + a + d 退出session

    5.卸载XXX包

    adb uninstall com.house365.xiaomifeng

    6.Mybatis 自动生成文件

    java -jar mybatis-generator-core-1.3.2.jar -configfile generatorConfig.xml -overwrite

    7.卸载

    adb uninstall com.house365.xinfangbao

    8.关闭防火墙

    firewall-cmd --zone=public --add-port=端口/tcp --permanent
    firewal-cmd --reload

    相关文章

      网友评论

          本文标题:Linux 常用命令

          本文链接:https://www.haomeiwen.com/subject/nxsmvftx.html