Mazyod
Mazyod

Reputation: 22559

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?

Upvotes: 1

Views: 431

Answers (1)

Cfreak
Cfreak

Reputation: 19309

Tell find to follow symlinks with -L

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

Upvotes: 4

Related Questions