Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.