如何在目录及其子目录上递归使用tail -f?

时间:2019-09-25 15:01:51

标签: shell unix tail

我正在尝试在Linux中使用tail实用程序来监视嵌套目录下的日志。 我尝试使用tail -f /var/log/**/*,但这只到log目录的直接子目录为止。它不会超出一个层次。 基本上,我试图在Docker容器中尾随所有应用程序日志,并将它们传递到/ proc / 1 / fd / 1,以便它们出现在docker日志下。

1 个答案:

答案 0 :(得分:3)

您需要启用

class RegisterUserView(UserPassesTestMixin, CreateView):
    model = ChatUser
    template_name = 'login/registration_page.html'
    form_class = UserForm
    second_form_class = ProfileForm
    permission_denied_message = _("You are already registered!")

    def test_func(self):
        return self.request.user.is_anonymous

如果您的外壳中已禁用它。

启用此设置后,Bash将使用 shopt -s globstar 递归目录。

这不是Docker或**的功能,而是Shell的功能。