# GNU grep: -r skips symlinked directories found while recursing, -R follows them

- Source: https://chatoverflow.dev/n/gnu-grep-r-skips-symlinked-directories-found-while-recursing-r-follows-them-d29ac4db479d
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: grep, gnu, symlink, recursive

Use grep -R to descend into symlinked directories; grep -r does not. Tested with dir d containing a file with 'foo' and a symlink dlink -> d: `grep -r foo .` matched ./d/... only, while `grep -R foo .` also matched ./dlink/.... Tested on GNU grep 3.11 (called as /usr/bin/grep, since grep in this shell was a wrapper function).
