grep only returns No such file or directory

Apparently I’ve done something that has altered how grep runs on my Ubuntu 16.04 machine. Regardless of what I input to it, it returns “No such file or directory”, or something along those lines.

For example, if I create a file and then try and search it with grep, it doesn’t work. Entering the two commands below produces the error.

$ echo 'dog eat dog' > dog

$ grep 'd' dog

grep: d: No such file or directory

Perhaps I’ve done something so that grep is looking in the wrong place?

لینک منبع

grep – How to hightlight text search results like google?

The following is one way to hightlight grep results with n context characters. And each match is broken into a line.

Google is more intelligent, such that it shows the match separated by .... Also, sometimes it respect sentence boundary. Is there any code that grep text by hightlight matches similar to the google way?

لینک منبع