GNU bug report logs - #78415
documentation: -R v -r difference is not just about symlinks

Previous Next

Package: grep;

Reported by: Matěj Cepl <mcepl <at> cepl.eu>

Date: Wed, 14 May 2025 01:58:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 78415-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Matěj Cepl <mcepl <at> cepl.eu>
Cc: 78415-done <at> debbugs.gnu.org
Subject: Re: bug#78415: documentation: -R v -r difference is not just about
 symlinks
Date: Wed, 14 May 2025 15:59:18 -0700
tags 78415 + notabug
stop

On Tue, May 13, 2025 at 6:58 PM Matěj Cepl <mcepl <at> cepl.eu> wrote:
> manpage grep(1) describes the difference between -r and -R options thus:
>
>     -r, --recursive
>         Read all files under each directory, recursively, following
>         symbolic links only if they are on the command line. Note
>         that if no file operand is given, grep searches the working
>         directory. This is equivalent to the -d recurse option.
>
>     -R, --dereference-recursive
>         Read all files under each directory, recursively. Follow all
>         symbolic links, unlike -r.
>
> It seems to me that outside of this advertised difference in
> following/non-following symlinks, -R option also makes grep to
> search through hidden directories. Is it so? Wouldn’t it be a
> good idea to put it into a manpage?

Please tell us why you think that.
At least for me, with either -r or -R, grep searches directories whose
names start with ".":

$ mkdir -p .j/.j && cd .j && echo a > .j/a
$ grep -r a
.j/a:a
$ grep -R a
.j/a:a

I'm marking this as done. If you show evidence of a problem, it's easy
to reopen.




This bug report was last modified 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.