查找不属于某些目录

时间:2018-09-20 14:20:37

标签: bash find

根据我的知识,

find .应该递归打印当前目录中的所有内容,但是当我在目录中使用它时,会得到以下内容

.
./WORKSPACE
./bazel-out
./lib
./lib/BUILD
./lib/hello-time.h
./lib/hello-time.cc
./main
./main/BUILD
./main/hello-world.cc
./main/hello-greet.h
./main/hello-greet.cc
./bazel-stage3
./bazel-bin
./bazel-testlogs
./README.md
./bazel-genfiles

但是,这还不是全部-至少文件夹bazel-bin包含一些文件。实际上,如果我运行find bazel-bin,这就是我得到的:

bazel-bin/
bazel-bin/lib
bazel-bin/lib/_objs
bazel-bin/lib/_objs/hello-time
bazel-bin/lib/_objs/hello-time/hello-time.pic.d
bazel-bin/lib/_objs/hello-time/hello-time.pic.o
bazel-bin/lib/libhello-time.a
bazel-bin/lib/libhello-time.a-2.params
bazel-bin/main
bazel-bin/main/_objs
bazel-bin/main/_objs/hello-greet
bazel-bin/main/_objs/hello-greet/hello-greet.pic.o
bazel-bin/main/_objs/hello-greet/hello-greet.pic.d
bazel-bin/main/_objs/hello-world
bazel-bin/main/_objs/hello-world/hello-world.pic.o
bazel-bin/main/_objs/hello-world/hello-world.pic.d
bazel-bin/main/libhello-greet.so
bazel-bin/main/hello-world.runfiles_manifest
bazel-bin/main/libhello-greet.so-2.params
bazel-bin/main/hello-world-2.params
bazel-bin/main/libhello-greet.a-2.params
bazel-bin/main/hello-world.runfiles
bazel-bin/main/hello-world.runfiles/__main__
bazel-bin/main/hello-world.runfiles/__main__/main
bazel-bin/main/hello-world.runfiles/__main__/main/hello-world
bazel-bin/main/hello-world.runfiles/MANIFEST
bazel-bin/main/libhello-greet.a
bazel-bin/main/hello-world

为什么find .不能进入bazel-bin?

谢谢。

1 个答案:

答案 0 :(得分:2)

我敢打赌,bezel-bin是当前目录中的软链接。

查找不会遍历软链接。您应该尝试find . -follow