Issue
In normal cases, I suppose everyone only uses the "less" command to read the content of plain text files.
But on Gentoo, it seems that the less command line is a little more powerful than the one I use on other Linux distributions, or Cygwin, Mac OS X... the less command on Gentoo is able to list the content of compressed archive files, the ELF header and other information of executable files, and maybe more... I can't remember on what platform it was, but I think it is also possible to read PDF files with some versions of "less" (or maybe was it just a dream?).
So I wonder if there is a way to easily make extensions for the less command, for example to make it able to read (display in a nice way) some format of binary files. I searched for information about this on Google, but didn't find anything.
Solution
Have you looked at lesspipe.sh
?
Actually, lesspipe.sh
only processes file or url before piping to less. BTW, I'm not using this, but I often type ps2ascii some.pdf | less
to read pdf files.
Answered By - nonowarn Answer Checked By - Clifford M. (WPSolving Volunteer)