I am trying to grep a list of IDs present in file1 from file2

I write:

grep -f file1 file2

The command gets stuck as if perpetually in the run phase.

Then I try:

fgrep -f file1 file2

This works in a flash. The man page of grep says that fgrep is same as "grep -f". But then how come I get no output for "grep -f"

有帮助吗?

解决方案

You cite the man page incorrectly! What is written there is this:

fgrep is the same as grep -F

Note the uppercase -F which is quite different to -f!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top