Linux日常命令记录

1、查找进程

ps -ef | grep java
jps

2、杀死进程

kill -9 1827

3、进入tomcat中的日志文件夹

cd logs

4、查看日志

tail -f catalina.out
tail -n 10000 catalina.out

5、查看tomcat的连接数

ss -nat|grep -i "8081"|wc -l
netstat -nat | grep -i "8081" | wc -l

 ------------------------------------------------------------------

遇到一个需求是需要把帆软报表中sql的round、floor、ceil替换为trunc(不再四舍五入)

1、在当前目录下全词匹配round关键字

grep "\<round\>" *
grep –w "round" *.cpt
grep "s/\<round\>/i" *.cpt

2、使用sed替换

sed -i 's/\<round\>/trunc/g' *.cpt
sed -i 's/\<round\>/trunc/i' *.cpt(不区分大小写)

 

posted @ 2018-01-03 16:46  膜拜曾文正  阅读(231)  评论(0编辑  收藏  举报