How do I highlight certain word using the cat command on the terminal?
Asked
Active
Viewed 1,971 times
0
Wissam Roujoulah
- 3,204
- 1
- 12
- 21
John
- 1
- 1
1 Answers
-1
Type cat (the name of your textfile) | grep (The word you want to highlight), e.g cat textfile | grep in.
-
2This would only work if grep is aliased with --color. In addition, it is not needed to cat and then grep, you can just `grep some_word textfile` – Zumo de Vidrio Jan 25 '17 at 13:59
-
To be fair, the question requires the use of cat :) – dhag Jan 25 '17 at 14:32