问题
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?
回答1:
Tell find
to follow symlinks with -L
find -L ../Classes -name \*.cpp -print
来源:https://stackoverflow.com/questions/16693828/bash-read-all-files-in-a-directory-recursively-includinging-symbolic-links