[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sun, 18 May 2008 18:07:06 -0600
> I was trying to do grep -fl <filename1> <filename2>
> it reported an error stating that:
> grep: l: No such file or directory
> Is it a bug or there is some logical reason behind it.
The -f option takes a filename. The grep documentation says:
grep [options] [-e PATTERN | -f FILE] [FILE...]
-f FILE, --file=FILE
Obtain patterns from FILE, one per line. The empty file con‐
tains zero patterns, and therefore matches nothing.
Saying "-fl" is the same as "-f l" says that "l" is a file of
patterns. If there is no such file or directory named "l" in the
current directory to satisfy that option then that is the logical
reason behind it complaining that it cannot be opened.