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

前端 未结 4 1744
小鲜肉
小鲜肉 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 16:57

    To log all the files inside a folder, you can go to the folder and write

    tailf *.log
    

    To add the subfolders to the tailf command, use

    tailf **/*.log
    

    Instead of tailf you can also use tail -f. Of course, the regular expression can be improved to match only specific file names.

提交回复
热议问题