highlight - highlight strings matching perl regular expressions in files
%highlight -i 'hello world' menu.h main.c
%highlight '\d+' --color 'bright blue on yellow' *.txt
%head -n20 mail.txt | highlight -l '^Subject:.*'
%highlight --help
highlight [OPTION]... PATTERN [FILE]...
Highlight PATTERN in each FILE or standard input. PATTERN is a perl regular expression.
- -i, --ignore-case
-
Ignore case distinctions.
- -m, --multiline
-
Consider PATTERN as a multiline expression. This will add the '/ms' flags to the Perl regular expression.
- -l, --highlight-line
-
Highlight the entire line instead of just the match.
- -n, --line-number
-
Print line number with output lines.
- -H, --with-filename
-
Prepend each line with the current file's name.
- -h, --no-filename
-
Suppress the prefixing filename on output.
- -s, --no-messages
-
Suppress error messages about nonexistant or unreadable files.
- --label=LABEL
-
Print LABEL as filename for the standard input.
- -c, --color=COLOR
-
Use COLOR to highlight the matches. COLOR may be expressed either as a human-readable color like "dark blue" or "bold green", or as the numbers in an ANSI escape code (e.g. "31", "1;34;42"). Your terminal may not be able to display all codes.
- --help
-
Display this help screen
- -V, --version
-
Display the script's version and copying information.
Martijn van der Kwast <[email protected]>
This file is copyright (c) 2011-2013 Martijn van der Kwast <[email protected]>. All rights reserved.
This script is free software; you may redistribute and/or modify it under the same terms as Perl itself.
Most of what this program does can be reproduced with grep using the -C
and --color
options.