Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • The question is not really understandable. What are you trying to achieve ? Vim depending of configuration is doing what you are looking when you are searching a word in an open file. Commented Jan 26, 2017 at 15:01
  • 1
    @netmonk With all due respect, what part of "Show the contents of a text file, with every occurrence of a word highlighted" do you not understand? Commented Jan 26, 2017 at 15:06
  • Possibly related: Convince grep to output all lines, not just those with matches Commented Jan 26, 2017 at 15:11
  • Well, your answer is supposing he wants to do it in an interactive shell. No precision so far about any context. My vim suggestion can be valid so far, as far as information are missing. That is why, the original question is not really understandable. Commented Jan 26, 2017 at 15:11