shell - 相当于 'find' 用于在 linux 终端中查找目录?

标签 shell find

是否有像“find”这样的实用程序来代替在 linux/unix 终端中查找具有用户指定名称的目录(或者 find 中的一个选项可以启用相同的功能)?

最佳答案

你可以使用 find 加上选项 -type d (d = only directory, f将只返回文件)。

使用 -name "pattern" 搜索区分大小写。 pattern 可以包含 *(任意数量的未知字符,包括无)或 ?(正好是一个任意字符)。

使用 -iname "pattern" 搜索不区分大小写。

例子:

find /home -type d -iname "public*html"

将在 /home 下的任何位置找到 public_htmlpublichtmlPublicHtml

相关:

关于shell - 相当于 'find' 用于在 linux 终端中查找目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31296872/

相关文章:

c++ - 为什么使用 `std::map::find` 来检查 map 是否有 key ?

bash - 如何进入每个目录并执行命令?

linux - 使用 shell 查找文件夹中没有指定文件模式的目录

django - django开发服务器运行时,如何 curl 127.0.0.1/8000?

shell - 从 shell 脚本将 RVM 安装为多用户

regex - 从这么多文件的开头删除数字的最快方法是什么?

git - Emacs:为什么 shell 命令 "git log"有效,但 "git shortlog"无效?

linux - 在深度 2 编辑所有文件

javascript - 有没有办法在javascript中检测页面搜索中的查找

python - 在字典中查找具有最多值的键