Linux命令个人总结

-- 远程remote Debug
cd .../tomcat/bin
vi catalina.sh JPDA_ADDRESS="{ip}:8000"
./stopapp.sh ;./catalina.sh jpda start(关闭watchdog防止5min重启)
./shutdown.sh ;./catalina.sh jpda start
idea 修改 remote debug启动。

抓包 tcpdump -i any port 18109 -vv -s0 -w dos.cap

查询具体服务 ps -ef | grep {fileName}

显示服务器时间 date +%s 000

全局搜索
$ find / -name 'etcd'

将目前目录下的所有文件与子目录的拥有者皆设为 runoob,群体的使用者 runoobgroup:

chown -R runoob:runoobgroup *

https://blog.csdn.net/win_turn/article/details/50386943

删除临时.文件

Swap file " .swp" already exists!

ll -a 

rm -f .swap

环境上的sql执行历史:
环境上执行mysql
mysql -u {user} -h {host} -p {password}: 

show databases;use mysqldb;

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

上下文(多行汇聚)
grep -C 5 -E '02538500000000000000000000000000' run.log | sed -E 's/(02538500000000000000000000000000)/\x1b[31m\1\x1b[0m/g'

grep -A 30 -B 5 'Could not initialize class org.opensearch.core.xcontent.XContentBuilder' run.log | sed -E 'Could not initialize class org.opensearch.core.xcontent.XContentBuilder'

grep "SQLException" run.log

-----各种异常类型
grep -oE '\b\w+Exception\b' run.log | sort | uniq -c | sort -nr

grep -oE '\b\w+Exception\b' cse_run.log | sort | uniq -c | sort -nr

gz压缩文件
zgrep "0253850000" run-1.log.gz | head -n 200

ls -lh

# 逻辑与
grep "xxEsTask" run.log | grep "m13816"
grep -P 'xxEsTask.*m13816' run.log

# 逻辑或
grep -E 'xxEsTask execution complete|m15639187110016' run.log

# 匹配 "ERROR" 且 不包含 "Ignore"
grep "ERROR" run.log | grep -v "Ignore"

grep "703665" run.log

# 匹配 ("ERROR 200" 或 "WARN 500") 且 包含 "Request"
grep -E "(ERROR 200|WARN 500)" run.log | grep "Request"

csv格式check \u0001
head bill_log.log|cat -v

10行分隔符
cat -A xxx.tmp | head -n 10
tail -f 5 xxx.tmp | cat -A


->

posted @ 2022-05-25 20:43  dos_fy  阅读(32)  评论(0)    收藏  举报