Walker News

How To Fix Weird Character In Linux Man Page

GUI applications used to be intuitive enough that most users should be able to start work with less effort as possible.

However, every new and advanced Linux users who are working with command line has no choice but to use the help system from time to time, i.e. the Linux man page or manual page with the man command!

If you’re reading the Linux manual page over the remote session, either with SSH or Telnet protocol, you might notice that there are some weird characters display on some Linux man pages, as seen in this screenshot (taken by Snipping Tool) when I ran man sudoers command in Red Hat Enterprise Linux.

Linux man page or manual page display weird characters when reading over SSH or Telnet session.

How to fix these weird characters displayed in Linux man page or manual page?

Simple trick to fix Linux man page or manual page displaying weird characters.

Well, the trick is quite simple. All you need is just append this single line into the Linux man page configuration file, i.e. /etc/man.config:
NROFF /usr/bin/groff -Tlatin1 –mandoc

UPDATE: This -Tascii is a better option.
NROFF /usr/bin/groff -Tascii -mandoc

Thereafter, the man sudoers will looks normal – render the proper characters instead of weird characters in the Linux man pages. (sudoers is the sudo configuration file – see also how to format the sudo –l output in more readable format)

I’ve confirmed that this groff formatting trick works in Red Hat Linux 8 Professional and Red Hat Linux Enterprise Linux 4.

Custom Search

  1. Brett Jones 27-02-08@01:08

    After a year of dealing with funny characters, I figured, what the heck – google might have the answer! You were the top link on my search and it works beautifully!

    My eye doctor thanks you (as does my sanity!)

  2. Mike 11-02-10@23:55

    Thanks so much! Finally a fix to this weirdness. Works on Debian!

  3. Mike2 31-08-10@09:18

    Be aware that formatted man pages are cached. Use man with the ‘-c’ flag to ignore the cache and regenerate the man page utilising any changes to /etc/man.config.

  4. Damocles 20-08-11@02:17

    What I have been searching for is the syntax of man.config itself. The man page on it is awful. All it talks about is the NROFF command.

    You are supposed to be able to populate this file with pathnames to have “man” search (as opposed to “MANPATH”), but I have as of yet to find the correct syntax.

  5. cuzic4n 26-08-11@03:19

    Exactly what I needed. Ty. Worked on rhel5 but not rhel6..

    Rhel6 worked with either of these entries:

    NROFF           /usr/bin/groff -c -Tascii -mandoc 2>/dev/null
    NROFF		/usr/bin/nroff -c -Tascii -mandoc 2>/dev/null


    NROFF           /usr/bin/groff -c -Tascii -mandoc 2>/dev/null

2018  •  Privacy Policy