shell
沉宸尘
在程序员的道路上越走越远、、、
展开
-
linux忽略某些目录/文件的操作
linux命令,忽略目录/文件操作原创 2023-02-22 10:29:24 · 418 阅读 · 0 评论 -
shell脚本查询所有的error日志
#!/bin/shselect_dir=$1input_time=$2# 获取需要查询的时间if [[ "${input_time}" =~ 'd' ]]; then se_time="$(echo "${input_time}" | grep -Po "[0-9]+") days"elif [[ "${input_time}" =~ 'h' ]]; then se_...原创 2019-06-17 15:19:50 · 3320 阅读 · 0 评论 -
shell查询error日志,高效版
之前写过shell查询某时间段的error日志脚本对于较长的log,之前的shell脚本查询效率较低(因为循环了log的每一行来做查询)下面是高效版的shell查询error日志#!/bin/shselect_dir=$1input_time=$2if [[ "${input_time}" =~ 'd' ]]; then se_time="$(echo "${inpu...原创 2019-06-26 09:26:45 · 1649 阅读 · 0 评论