sh 查找云端服务器上的所有访问日志,并将它们合并为一个输出
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 查找云端服务器上的所有访问日志,并将它们合并为一个输出相关的知识,希望对你有一定的参考价值。
# Run from /home/master/applications
# dumps everything to the screen
find . -maxdepth 3 -path '*/logs/*access*.log' -exec cat {} +
# Run from /home/master/applications
# continuously outputs everything to the screen. Shows headings for each file that's outputting
ls -drt */logs/*access*.log | tail -n5 | xargs tail -n0 -f
# Run from /home/master/applications
# outputs to file: /home/master/access-logs-all.log
find . -maxdepth 3 -path '*/logs/*access*.log' -exec cat {} + > ~/access-logs-all.log
# Run from /home/master/applications
# outputs to file: /home/master/access-logs-all.log
find . -maxdepth 3 -path '*/logs/*error*.log' -exec cat {} + > ~/error-logs-all.log
以上是关于sh 查找云端服务器上的所有访问日志,并将它们合并为一个输出的主要内容,如果未能解决你的问题,请参考以下文章