Linux: Less or more command with colors

1137440 pts.
Tags:
Linux
In Linux, when I'm trying to read a file with the command 'less' or 'more', is there a way to get my content with colors? Thank you.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    In short, no, AFAIK. However...

    Since source is available for both more and less, it's possible to make them both do it. Just start programming.

    For potentially a little less effort, I think it can be done for "less", but not for "more". There are two options for less that might be combined along with a preprocessor that inserts color control codes into the file.

    If you can find a colorizing utility, you might use it as the preprocessor. Feed its output into less, and enable the option that handles raw color control codes.

    For more, there seems to be no way other than doing some custom programming. And since vi and many other editors can do colors, it hardly seems worth anyone's effort to get more and less to do it.
    34,465 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: