lesspipe is a great tool:
lesspipe.sh is an input filter for the pager less as described in less‘s man page. The script allows you to view files with binary content, compressed files, archives and files contained in archives.
… however getting it to run on OpenSUSE was a bit of a journey as it is not part of the standard OpenSUSE 12.x repository. You can only get ‘unstable’ lesspipe packages, of which the Show home:adra / lesspipe – openSUSE Build Service seems to be maintained most frequently.
This is how to install it from there:
zypper addrepo http://download.opensuse.org/repositories/home:adra/openSUSE_Factory/home:adra.repo
zypper refresh
zypper install lesspipe
I am using the bash shell, so after doing that, I had to add this line to my my ~/.bashrc
LESSOPEN="|lesspipe.sh %s"; export LESSOPEN
You can-reapply your ~/.bashrc, but note that it can give issues when appending existing environment variables like PATH. From
bash – How do I reload .bashrc without logging out and back in?:
Use the source command (or the dot shortcut .) which – depending if your .bashrc is in the current directory, can be any of these:
source .bashrc. .bashrcsource ~/.bashrc. ~/.bashrc
–jeroen
via:
- linux – How can I have `less` automatically decompress `xz` files like it did with `gz` files on my old SUSE distro? – Super User.
- software.opensuse.org: Install package home:adra / lesspipe.
- lesspipe, an addon for the browser less.
Filed under: *nix, Linux, Power User, SuSE Linux