Linked Questions

10
votes
2answers
26k views

How to highlight a word in the output of “cat”? [duplicate]

I can do the following to see if some word is available in the output of "cat": cat filename | grep word This filters the output and shows only those lines which contain "word". Now, is it possible ...
5
votes
4answers
2k views

Color matching but print other lines too [duplicate]

I have an alias: alias grep='grep --color=auto'. I wish to have some way to print not only matching row but all of them and just color matching patterns. I doubt is there an option to do that in the ...
3
votes
4answers
159 views

highlight a word without affecting the structure of text [duplicate]

$cat contents.txt cat-1.15 cat-1.15 cat-1.15 cat-1.18 The above output has blank lines $cat contents.txt | grep cat results in the word cat being highlighted, but the resultant text is also ...
1
vote
2answers
644 views

Bash: Show the contents of a text file, with every occurrence of a word highlighted [duplicate]

How can I show the contents of a text file, with every occurrence of a word highlighted?
0
votes
3answers
712 views

Grep display both matched and umatched lines [duplicate]

How can I use grep command to display both matched and unmatched lines? Matched line should be in red and other lines should be in normal color. Is there a grep option available to do that?
3
votes
1answer
642 views

bash: color matching string [duplicate]

I am looking for a command which would color a matching string in text. I.e. I am looking for functionality similar to what grep does, but I want to see the complete text not only the matching lines ...
1
vote
1answer
241 views

Pattern highlighting command [duplicate]

Folks, I want to know if there exists a command that just highlight some portions of the input text, rather than filtering it like grep does. To give an example, suppose the following input text: ...
0
votes
1answer
526 views

Highlight patterns in command output (grep-like but without excluding lines) [duplicate]

I need a command that colorizes some symbol sequence in output of a certain command. I'd like it like grep make it. $ some-command | grep symbol-sequence However grep removed lines that isn't ...
-1
votes
1answer
57 views

Linux how to highlight every occurrance of a word. [duplicate]

how do I highlight every occurrence of a word, Linux? I have tried to show the contents of my file but I don't know how to highlight specific words! please help!!
19
votes
6answers
4k views

Why is aliasing over standard commands not recommended?

For example, a common alias I've seen in the ~/.bashrc file (or equivalents) is alias rm='rm -i' However, I've seen people recommend against this because the alias might not exist on another system ...
11
votes
7answers
9k views

`highlight` command

Is there a command which can be used to easily highlight (with colors, bold text or inverted back-/foreground) specific strings in stdin while passing the entire string to stdout? I'm thinking of ...
0
votes
1answer
1k views

How to highlight certain word? [duplicate]

How do I highlight certain word using the cat command on the terminal?
2
votes
3answers
53 views

Is there a way to colourize the output of a command without using bashrc/bash_profile?

I have made a program where I can read several logs from different programs, I want to colourize certain terms in the output , so I can find the more interesting parts. (I will not use grep or ...
0
votes
0answers
102 views

Highlight specific text in command output, allowing interaction with the command

Is there a grep -like command to highlight specific text in a command's output, but shows all lines irrespective of the presence of the desired text and allows one to interact with the piped(1) or ...
0
votes
1answer
29 views

Select lines of text files which have id-string combinations listed in another file

How do I get only the lines with the strings given by list_of_od_strings.txt file_with_strings_in_lines.xml? This question is similar to Select lines from text file which have ids listed in another ...