简体   繁体   中英

BASH: Read all files in a directory recursively, includinging symbolic links

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM