【问题标题】:How can I "clip" the output of the find command?如何“剪辑” find 命令的输出?
【发布时间】:2010-09-20 06:55:38
【问题描述】:

我执行了以下命令:

find / -type f -name fs-type -exec svnlook tree {} \; |egrep "/$" 

结果是

svnlook: Can't open file '/var/lib/svn/repos/b1me/products/payone/generic/code/core/db/fs-type/format': Not a directory 
svnlook: Can't open file '/var/lib/svn/repos/b1me/products/payone/generic/code/fees/db/fs-type/format': Not a directory

也许我应该让find 命令给我没有db/fs-type/format 的路径,换句话说我应该剪辑find 的输出。我该怎么做?

【问题讨论】:

  • 您能否详细说明您希望达到的目标?
  • 1.我想找到所有存储库.... 2. 我想找到所有存储库的整个目录....注意:执行步骤一的结果超过 500 个存储库,所以我需要通过简单的方法执行步骤二
  • 删除了“repository”、“solaris”和“ubuntu”标签。这个问题是从 unix find 命令调用颠覆管理员评论的问题

标签: linux svn


【解决方案1】:

首先你可以给

find ... -not -path "*/db/*"

寻找。

【讨论】:

  • 不起作用,出现以下结果:find: bad option -not find: path-list predicate-list
  • 听起来好像没有 GNU find ? (你在做 solaris 吗?)
【解决方案2】:

这就是你要找的东西

find Subversion -type d -name db -exec svnlook tree {}/.. \; | egrep "/$"

您的命令失败了,因为 svnlook 需要一个目录参数而不是文件参数。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-07-01
    • 2012-10-28
    • 1970-01-01
    • 2011-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-29
    相关资源
    最近更新 更多