Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

groffer Command in Linux with Examples

  • Difficulty Level : Easy
  • Last Updated : 06 Jan, 2021

groffer command in Linux displays groff files and man pages on an X window system, tty, and several other document viewers. 

  • groff files – files made by using groff command. Groff is typically used to create man pages.
  • man page – man page(manual page) is documentation of different commands available in Linux.
  • X window system(X) – X Windows system provides the base for GUI on Linux Operating System.
  • tty – tty is short of the teletype, but popularly known as a terminal. It allows us to interact with the system.

We can also decompress the compressed files that are handled by gzip or bzip2 with the help of groffers command very easily.

Installation :

In some Linux distros, groffers command is not installed by default.  You can do it using apt package manager by entering the following command in cmd:

sudo apt install groff

Syntax :



groffer [mode-option ...] [groff-option ...] [man-option ...] [X-option ...]
         [--] [filespec ...]

Note: The filespec parameters are not optional parameters. They are to be provided by the user for groffer command to work or display some sort of output. 

Working with groffer Command:

1. To display a file or man page.  By default, groffer will display these files in PDF format.

groffer printf

1. To display a file or man page.  By default, groffer will display these files in PDF format.

2. To concatenate multiple files into one pdf.

groffer printf scanf file.txt

2. To concatenate multiple files into one pdf.

3. To display man pages categorized into different sections. For example, printf command has two section_extensions: printf(1) and printf(3).

groffer printf.1 printf.3

To display man pages categorized into different sections

Note: In Linux systems, these section_extensions  are denoted by a digit from 1 to 9 while in UNIX systems by one of the characters from n & o.   
4. To search the filespec argument in man page descriptions.



groffer --apropos printf

Note: section_extension isn’t supported with the apropos command. 

5. To display all the man pages related to the given filespec argument. Example: Searching printf with –all option will also display synopsis about printf, fprintf, dprintf, sprintf, snprintf, vprintf, etc.

groffer --all printf

To display all the man pages related to the given filespec argument.

6.   To display the files or man pages in the Postscript viewer program (ps mode).

groffer --ps printf

To display the files or man pages in the Postscript viewer program (ps mode).

7.  To generate device output with plain Groff.

groffer --groff printf

To generate device output with plain Groff.

8. To display the output in terminal or tty mode.

groffer --tty printf




My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!