【问题标题】:Find leaf directories contained within directories matching a wildcard查找包含在与通配符匹配的目录中的叶目录
【发布时间】:2021-06-04 11:15:50
【问题描述】:

以下工作非常好。它让我得到叶子目录。

find .  -type d -links 2

我需要的是下面的东西。在当前目录中,有名为 C2S7* 的目录,其中我需要叶子目录。

find . -name "C2S7*" -type d -links 2

以上内容也在叶目录名称中查找通配符。有什么选择?

【问题讨论】:

    标签: linux find wildcard


    【解决方案1】:

    查看与模式匹配的直接子代:

    find C2S7*/ -type d -links 2
    

    查看与模式匹配的直接或间接子代:

    find . -path "*/C2S7*/*" -type d -links 2
    

    Specification.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-08
      • 2013-01-07
      • 2013-04-03
      • 2014-02-04
      • 2011-04-15
      相关资源
      最近更新 更多