BASH:递归读取目录中的所有文件,包括符号链接

问题描述:

我从某人那里得到了这个整洁的脚本:

I got this tidy script from someone:

find  ../Classes -name \*.cpp -print

只是循环目录,并递归打印所有文件.但是,它不遵循符号链接.我在网上能找到的就是:

which simply loops a directory, and prints all files recursively. However, it doesn't follow symlinks. All I can find online is:

find ../Classes -name \*.cpp -type l -print

但是,由于目录是符号链接,而不是文件,因此它什么也不输出. 我该怎么解决?

But, since the directory is the symlink, not the files, it outputs nothing. How can I solve that?

告诉find使用-L

find  -L ../Classes -name \*.cpp -print