I found if I search using grep without specifying a path, like grep -r 'mytext' it takes infinitely long. Meanwhile if I search with path specified grep -r 'mytext' . it instantly finds what I need. So, I'm curious, in first form, in which directory does grep search?
UDATE: grep version: grep (GNU grep) 2.10
foomytextbar(followed by Enter) after runninggrep -r 'mytext'. – sr_ May 16 '12 at 13:42grepis that. With the GNUgrepI use on Linuxgrep -r 'mytext'andgrep -r 'mytext' .does the same thing: search recursively starting from the current directory. When the-rswitch is used GNUgrepnot searches STDIN. – manatwork May 16 '12 at 14:12grep2.12: pastebin.com/L4my26QS In meantime I found this in the NEWS file regarding version 2.11 (2012-03-02): "If no file operand is given, and a command-line -r or equivalent option is given, grep now searches the working directory. Formerly grep ignored the -r and searched standard input nonrecursively. An -r found in GREP_OPTIONS does not have this new effect." – manatwork May 16 '12 at 15:06