简体   繁体   English

在文件夹中查找文件夹的命令

[英]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.

相关问题 在 Linux 中查找特定父文件夹并删除子文件夹中的文件 - Find specific parent folder and delete files inside sub-folders in Linux 删除其中包含其他文件夹的文件夹 - delete a folder that inside contains other folders 如何通过查找命令在文件夹列表中查找字符串 - how to find a string in a list of folders from a find command 按名称查找文件夹并将其子文件夹的权限递归设置为755 - Find a folder by name and recursively set it's childrens folders permission to 755 Linux:查找所有具有特定名称的文件夹,将其删除,然后将一个文件夹复制到这些文件夹的父目录中 - Linux: Find all folders with a particular name, remove them and have a folder copied into the parent directory of those folders 如何停止使用点(。)列出文件夹中的查找命令 - How to stop find command from listing folders with dot(.) 查找命令:删除除一个文件夹外的所有内容 - find command: delete everything but one folder 查找特定文件夹,然后在其中搜索特定文件以查找单词 - Find specific folders then search specific files inside them for a word 删除linux目录中的所有文件夹和文件,除了一个文件夹和该文件夹中的所有内容 - delete all folders and files within a linux directory except one folder and all contents inside that folder 在文件夹中的 gzip 文件中查找字符串 - find string inside a gzipped file in a folder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM