如何“剪辑”find命令的输出?

时间:2022-10-29 15:03:00

I executed the following command:

我执行了以下命令:

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

The result was

结果是

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

Maybe I should make find command give me the path without db/fs-type/format in other words I should clip the output of find. How can I do this?

也许我应该让find命令给我没有db / fs-type / format的路径换句话说我应该剪切find的输出。我怎样才能做到这一点?

2 个解决方案

#1


0  

First you can give

首先你可以给

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

to find.

#2


0  

This is what you're looking for

这就是你要找的东西

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

Your command was failing because svnlook expects a directory argument not a file one.

您的命令失败,因为svnlook期望目录参数不是文件参数。

#1


0  

First you can give

首先你可以给

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

to find.

#2


0  

This is what you're looking for

这就是你要找的东西

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

Your command was failing because svnlook expects a directory argument not a file one.

您的命令失败,因为svnlook期望目录参数不是文件参数。