Just how can I highlight suits making use of GNU grep?
--color alternative has actually been currently stated numerous times, yet I would certainly such as to add that it's feasible to set up the shade in which the suits will certainly be highlighted making use of a setting variable
The shade need to be inscribed making use of ANSI shade codes, for reference
Black 0;30 Dark Gray 1;30 Blue 0;34 Light Blue 1;34 Green 0;32 Light Green 1;32 Cyan 0;36 Light Cyan 1;36 Red 0;31 Light Red 1;31 Purple 0;35 Light Purple 1;35 Brown 0;33 Yellow 1;33 Light Gray 0;37 White 1;37
I've located that the most effective means to pander grep is to make use of ack, which is basically recursive grep with a smart overlook checklist (as an example, does not search.svn directory sites, overlooks back-up documents, etc), colour highlighting of outcomes and also perl regexps. It's what you desire grep to do 98.6% of the moment.
alias cgrep='grep -nR --color'
$ cgrep somestring /path/to/dir/or/file/with*/possible/*wild.card
Additionally among my faves :
$ pgrep some-hanging-process
will certainly detail all pids of procedures that match the name of some - dangling - procedure which you can make use of in adhering to scenario :
$ kill $(pgrep some-hanging-process)