[英]Command to find a folder inside folders
I need a terminal command to find all instances of a folder inside folders. 我需要一个终端命令来查找文件夹内文件夹的所有实例。
I need to find all instances folders with the name ' builder ' inside the folder ' www ' including all folders inside 'www'. 我需要在文件夹“ www ”内找到所有名称为“ builder ”的实例文件夹,包括“ www”内的所有文件夹。
I tried with: 我尝试过:
find www -path '*/builder/*' -type d > list
but nothing, no error. 但没有,没有错误。
Proper way of using find
正确使用
find
find www -name "*builder*" -type d -print
(or) (要么)
find www -name "*builder*" -type d -printf "%f\\n"
where a glob construct *builder*
is passed as input to the -name
field which searches all directories under www/
whose names have the string present. 在其中,将glob构造
*builder*
作为输入传递到-name
字段,该字段在www/
下搜索名称中存在字符串的所有目录。
How about: 怎么样:
find www -name builder -type d
This will print the relative pathes (starting with www) to all folders named "builder" on standard output, one path per line. 这会将相对路径(以www开头)打印到标准输出上所有名为“ builder”的文件夹,每行一个路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.