There is an answer in superuser.com:
your-command | grep -E --color 'pattern|$'
or
your-command | grep --color 'pattern\|$'
This will “match your pattern or the end-of-line on each line. Only the pattern is highlighted…”
More Related Contents:
- sh: 1: Syntax error: "(" unexpected error
- Iterate over a list of files with spaces
- How to declare 2D array in bash
- Defining a variable with or without export
- What does $@ mean in a shell script?
- The ‘eval’ command in Bash and its typical uses
- Better way to rename files based on multiple patterns
- Syntax error in shell script with process substitution
- Raise error in a Bash script
- Linux: copy and create destination dir if it does not exist
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- How to run a shell script on a Unix console or Mac terminal?
- How to preserve line breaks when storing command output to a variable?
- How to use sed to remove the last n lines of a file
- Use sudo without password INSIDE a script
- Passing variables in remote ssh command
- How do I run multiple background commands in bash in a single line?
- Round a divided number in Bash
- How do I change bash history completion to complete what’s already on the line?
- Bash: wait with timeout
- Multithreading in Bash [duplicate]
- Randomly shuffling lines in Linux / Bash
- Running shell script in parallel
- Difference between shell and environment variables
- Replacing Control Character in sed
- SUID not working with shell script
- Linux shell script to add leading zeros to file names
- bash double bracket issue
- Need to remove the count from the output when using “uniq -c” command
- How do you run a script on login in *nix?