Another option (depending on system): use the groff
tool with the appropriate troff
post processing macro for output to a TTY device, e.g. utf8
.
# To stdout
$ groff -man -T utf8 file.1
# From archive via pipe
$ zcat file.1.gz | groff -man -T utf8 -i
# Pass to less
$ groff -man -T utf8 file.1 | less -R
...
One can use grog
to detect what macro to use, and optionally execute by using --run
and passing options to groff. For example:
$ grog file.1
groff -man file.1
$ grog --run -T utf8 file.1
groff -T utf8 -man file.1
[DOC]
...
- groff - front-end for the groff document formatting system.
- grog - guess options for a following groff command.
- groff_tmac - macro files in the GNU roff typesetting system.
- groff_man - compose manual pages with GNU roff.
- grotty - groff driver for typewriter-like devices.
- nroff – use groff to format documents for TTY devices.
- troff - the troff processor of the groff text formatting system.
man
built upongroff
exists on at least (older) FreeBSD and Linux-based operating systems.groffer --tty your_file
is probably an easy way. (I see thatgroffer
is provided by the groff package on Ubuntu, which is likely not installed by default).