Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
54
rated 0 times [  54] [ 0]  / answers: 1 / hits: 46342  / 2 Years ago, sun, march 27, 2022, 6:58:07

Sometimes I quickly want to view the contents of a file from the command line. For this I of course use cat, but it is often source files in Python, Java or simple HTML. For these files it would be handy if cat could give some color markup to the files, so that it reads more easy.



Can cat do such a thing?


More From » colors

 Answers
7

cat is not able to do this. However, maybe pygments may be able to help you there. It is a python script and can be either installed via apt-get



sudo apt-get install python-pygments


or easily downloaded and installed via easy_install.



It supports lots of source code languages and also markup languages



It is used by



pygmentize -g <filename>

[#27461] Monday, March 28, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hamostic

Total Points: 403
Total Questions: 142
Total Answers: 112

Location: Iceland
Member since Sat, Sep 17, 2022
2 Years ago
;