0
点赞
收藏
分享

微信扫一扫

Linux小技巧

取消vim中搜索后文本高亮:

:nohl

修改主机名称:

vim /etc/hostname

查看java进程

jps

jar包启动脚本

cd /opt/deploy/websockettest/
nohup java -Dfile.encoding=utf-8 -Xms256m -Xmx512m -jar /opt/deploy/websockettest/websocket*.jar 2>&1 &

jar包停止脚本

#!/bin/bash
pid=`ps -ef | grep websocket_springboot.jar | grep -v grep | awk '{print $2}'`
echo "the pid of the process is ${pid}"
if [ -z "${pid}" ]
then
    echo "the process was already killed!"
else
    kill -9 ${pid}
    echo "kill process complete!"
fi

查看是系统是ubuntu还是CentOS

lsb_release -a

查看当前主机ip

hostname -I

举报

相关推荐

0 条评论