How do I Print Out a Linux man or info Page?

Some time it is necessary to print a Linux man or info page. To print a ls command man page type the following command:

$ man ls | col -b | lpr -P hp1_floor2

  • col -b : To format man page output, it will not show any special character such as backspaces
  • lpr -P hp1_floor2 : hp1_floor2 is the printer name of the Linux/UNIX printer queue

To print the man page with effects such as italic and bold fonts on the HP Laser Jet printer, enter:
$ zcat /usr/share/man/man1/ls.1.gz | groff -man -Tps | lpr -P hp1_floor2

You can save man page as a ps file, enter:
zcat /usr/share/man/man1/ls.1.gz | groff -man -Tps >


  1. zcat : Open compressed /usr/share/man/man1/ls.1.gz file
  2. groff : Go through groff document formatting system, which is responsible for formatting of man page with effects such as italic and bold fonts on both screen and printer
  3. lpr -P hp1_floor2 : hp1_floor2 is the printer name of the Linux/UNIX printer queue

Here is a shell script that we have installed on all Linux workstations, it saves man page in a text file and later user can print it using lpr command.

# Linux shell script to save man pages to text file
# so that later user can print them
# Created by nixcraft <>, under GPL v2.0 or above.
# ----------------------------------------------------------------------
[ ! -d "$OUTDIR" ] && mkdir -p "$OUTDIR"  :
for i in $CMDS
 man "${i}"  col -b > "$OUTDIR/${i}.txt"
echo "**********************************************************"
echo "All man pages saved to $OUTDIR directory"
echo "Just goto \"$OUTDIR\" directory and type the following command
to print man page(s):"
echo "lpr *.txt"
echo "**********************************************************"
exit 0

Just type the script-name followed by Linux commands, for example to print a man page of ls and bash type
$ saveman "ls bash"

Related: How do I print or make hard copies of Linux man and info pages?

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 3 comments so far... add one
CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
3 comments… add one
  • Charles McCreary May 27, 2012 @ 3:16

    I tried this:

    I think:
    man “${i}” col -b > “$OUTDIR/${i}.txt”

    should be
    man “${i}” | col -b > “$OUTDIR/${i}.txt”

  • Murpholinox May 31, 2012 @ 6:08

    and for (p)info pages how can I get the information into a pdf file?

  • Sebastian Feb 26, 2015 @ 22:45

    Very useful instructions. Although i did not quite understand how to find the correct value to pass to the -P switch, the printer-name/destination. But was able to find it eventually:

    $ lpstat -s
    system default destination: HP-Photosmart-7200
    device for HP-Photosmart-7200: hp:/net/Photosmart_C7200_series?ip=

    Where HP-Photosmart-7200 is the value i was looking for.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum