Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for a tool which takes a file in input and a word to search. It should display the file with color the words if it corresponds to the search.

Like grep --colors but displays all the file.

Is there something already exists ?

Example : cat /etc/passwd | colors root Display all /etc/passwd file and color the words "root"

If I can change the color easily it would be great !

share|improve this question
up vote 2 down vote accepted

A little trick with grep will do the job:

grep --color "^\|root" /etc/passwd

Otherwise look here.

share|improve this answer
Super ! I didn't find these entries ! Thanks a lot – Dom Dec 6 '12 at 8:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.