GNU bug report logs - #56453
Bug reports

Previous Next

Package: grep;

Reported by: "GUI" <1678556598 <at> qq.com>

Date: Fri, 8 Jul 2022 16:40:01 UTC

Severity: normal

Tags: notabug

Full log


View this message in rfc822 format

From: "GUI" <1678556598 <at> qq.com>
To: 56453 <at> debbugs.gnu.org
Subject: bug#56453: Bug reports
Date: Fri, 8 Jul 2022 19:35:41 +0800
[Message part 1 (text/plain, inline)]
I'm a beginner for Linux.
Today, when I was learning the grep command, I used the man command to check its manual and found a suspicious point.In its DESCRIPTION,it says "grep  searches  for  PATTERN  in  each  FILE.   A FILE of ¡°-¡± stands for standard input.  If no FILE is given, recursive searches examine the working directory, and nonrecursive searches read standard input.  By default, grep prints the matching lines. In addition, the variant programs egrep and fgrep are the  same  as  grep -E  and  grep -F,  respectively.   These  variants  are deprecated, but are provided for backward compatibility."
I think there are something wrong with the sentence 'If no FILE is given, recursive searches examine the working directory, and nonrecursive searches read standard input. ' . Pay attention to the 'and' in "recursive searches examine the working directory, and nonrecursive searches read standard input".When I use the grep command,such as this:


[root <at> localhost ~]# grep Download dwad dawdwa Downloads Downloads ^C [root <at> localhost ~]# 


From this result,we can see that if no file is given, nonrecursive searches read standard input instead of that rescursive searches examine the working directory.
As we known, the working directory is ~,whose subdirectories have 'Downloads'.So when you type grep Download on  terminal, you should see 'Downloads' under the current folder ~.
I don't know why or There is something wrong with the description of grep in the manual.
[Message part 2 (text/html, inline)]

This bug report was last modified 2 years and 344 days ago.

Previous Next


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