I have a folder with symlinks which are pointing to other folders, how can i recursively look into those folders? I would like to do a grep on those results to search for matches.
doing tree will only list the symlink as files.
You can use find with the -L option, e.g.,
find -L . -type f -exec grep foo {} \; That makes find follow symbolic links. Quoting POSIX:
-L
Cause the file information and file type evaluated for each symbolic link encountered as a path operand on the command line or encountered during the traversal of a file hierarchy to be those of the file referenced by the link, and not the link itself. If the referenced file does not exist, the file information and type shall be for the link itself.
grep -r 'somestring' *.