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

71 command-line directory find

我的服务器上有一个名为“exampledocs”的目录。我尝试使用以下方法找到它的位置:

ls -d */ | grep -E 'exampledocs'
Run Code Online (Sandbox Code Playgroud)

find * -regextype posix-extended \-regex 'exampledocs' \-type d
Run Code Online (Sandbox Code Playgroud)

grep "exampledocs" * --recursive
Run Code Online (Sandbox Code Playgroud)

没有任何效果。如何从命令行执行此操作?我正在使用 Ubuntu Server 11.0。

Noa*_*led 86

这也应该工作

find folder_full_path -name exampledocs -type d
Run Code Online (Sandbox Code Playgroud)


小智 70

find / -xdev 2>/dev/null -name "exampledocs" 
Run Code Online (Sandbox Code Playgroud)

注意:这是来自 Debian,但它应该可以工作。


小智 8

locate exampledocs | grep /exampledocs$