How to tail all the log files inside a folder and subfolders?

前端 未结 4 1740
小鲜肉
小鲜肉 2020-12-23 16:27

In Linux, using the command tailf, how can I tail several log files that are inside a folder and in the subfolders?

4条回答
  •  眼角桃花
    2020-12-23 17:06

    This way find files recursively, print lines starting on line 5 in the each file and save on concat.txt

    find . -type f \( -name "*.dat" \) -exec tail -n+5 -q "$file" {} + |tee concat.txt
    

提交回复
热议问题