手动日志切割及输出查看

1、切割日志

cat postgresql-2019-10-11.log |split -b 3G - postgresql-2019-10-11.log

 2、统计日志行数

cat postgresql-2019-10-11.log |wc -l

3、查看日志某几行

sed -n "3,10p" postgresql-2019-10-11.log >1.txt

4、指定行数分割

split -l 120000  postgresql-2019-10-11.log

原文地址:https://www.cnblogs.com/wangyong-blog/p/11690752.html