如何在我的服务器上找到具有特定名称的文件夹?

我在服务器上有一个名为"exampledocs"的目录,但是我试图使用以下命令找到它的位置:
ls -d */ | grep -E 'exampledocs'

find * -regextype posix-extended \-regex 'exampledocs' \-type d

并且

grep "exampledocs" * --recursive

没有任何方法有效。我该如何在命令行中完成这个任务?我正在使用Ubuntu Server 11.0。
4个回答

这也应该有效

find folder_full_path -name exampledocs -type d

1从整个计算机中找出它。 - Amitabha Biswas
1@AmitabhaBiswas 在命令中,你需要设置路径而不是使用“/”来搜索特定文件夹。 - heroin
这个效果更好 - Trect
找到 /path/to/search/ -name exampledocs -type d - Dawoodjee

find / -xdev 2>/dev/null -name "exampledocs" 

注意:这是来自Debian的,但应该可以使用。

定位 exampledocs | 过滤 /exampledocs$

使用bash的globstar shell选项和[[评估,我们可以利用递归通配符和前缀删除来查找包含所需字符串的目录。以下是我搜索bin文件夹的方法:
bash-4.3$ shopt -s globstar
bash-4.3$ for f in ./**/* ; do [ -d "$f" ] && [[ "${f##*/}" =~ ^bin$ ]] && echo "$f" ; done
./bin
./Desktop/TODAY/bin