groffer Command in Linux with Examples
Last Updated :
28 Apr, 2025
The groffer command is a powerful utility in Linux used for viewing Groff files and man pages on various platforms, including the X Window System, terminal (tty), and other document viewers. It simplifies the process of displaying formatted documents, allowing users to read and search manual pages or Groff-formatted files easily.
- 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 the 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 the groffers command very easily.
Installing the groffer Command
In some Linux distros, the groffers command is not installed by default. You can do it using the 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 ...]
- Mode Options: Control the output format, such as --ps for PostScript or --tty for terminal mode.
- Groff Options: Pass options directly to the groff command.
- Man Options: Options that affect the display of man pages.
- X Options: Control the display settings for the X Window System.
- Filespec: The file or man page to be displayed. This parameter is not optional and must be provided.
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
The most basic use of groffer is to display a file or man page. By default, it will display the content in PDF format.
groffer printf

2. To concatenate multiple files into one pdf
You can combine multiple files into a single output file for easier viewing using this command.
groffer printf scanf file.txt

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

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
The --apropos option allows us to search for a term 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

6. To display the files or man pages in the Postscript viewer program (ps mode)
Use the --ps option to view the output in a PostScript viewer.
groffer --ps printf

7. To generate device output with plain Groff
If you want to generate output using plain groff, use the --groff option.
groffer --groff printf

8. To display the output in terminal or tty mode
The --tty option forces the output to be displayed in a text terminal.
groffer --tty printf

Conclusion
The groffer command in Linux is a adaptable utility for displaying Groff-formatted files and man pages across different viewing interfaces. Its ability to handle compressed files and support multiple output formats makes it an essential tool for system administrators and developers who need to read documentation efficiently. By mastering the groffer command's various options and use cases, you can significantly improve your documentation viewing experience on Linux.
Similar Reads
groff Command in Linux with Examples
In Linux/UNIX, Groff stands for GNU troff. Groff is basically used to create man pages. But its functionality is not limited to creating man pages, rather it acts as a formatting and typesetting engine. It acts as a compiler for the input supplied to it and it creates a formatted document as its out
3 min read
fgrep command in Linux with examples
The 'fgrep' filter is used to search for the fixed-character strings in a file. There can be multiple files also to be searched. This command is useful when you need to search for strings that contain lots of regular expression metacharacters, such as "^", "$", etc. This makes 'fgrep' particularly v
4 min read
Groups Command in Linux With Examples
In Linux, there can be multiple users (those who use/operate the system), and groups are nothing but a collection of users. Groups make it easy to manage users with the same security and access privileges. A user can be part of different groups. The 'groups' command is a powerful tool that allows ad
3 min read
gs command in Linux with Examples
gs command invokes Ghostscript, which is an interpreter of Adobe Systems PostScript and Portable Document Format(PDF) languages. After executing Ghostscript it reads further input from the standard input stream until it encounters 'quit' command. Syntax: gs [ options ] [ files ] ... Options: Below a
2 min read
expr command in Linux with examples
The expr command in Unix is a versatile tool used for evaluating expressions in the shell environment. It performs a wide range of functions, including arithmetic calculations, string operations, and comparisons based on regular expressions.What is the 'expr' Command?expr stands for "expression" and
3 min read
file command in Linux with examples
The 'file' command in Linux is a vital utility for determining the type of a file. It identifies file types by examining their content rather than their file extensions, making it an indispensable tool for users who work with various file formats. The file type can be displayed in a human-readable f
3 min read
if command in linux with examples
if command in Linux is used for conditional execution in shell scripts.The if command is essential for writing scripts that perform different actions based on different conditions.if COMMANDS list is executed, if its status is true, then the then COMMANDS list is executed. Otherwise, each elif COMMA
4 min read
fc Command in Linux with Examples
As we all know that LINUX is command friendly and while working on LINUX, you may deal with very long commands that may include long paths or really difficult syntax, and imagine what if working with such commands you do a minor mistake which will require re-writing of the entire command synopsis an
3 min read
fg command in Linux with examples
The fg command in Linux is used to bring a background job into the foreground. It allows you to resume a suspended job or a background process directly in the terminal window, so you can interact with it.Syntaxfg [job_spec]The job_spec is a way to refer to the background jobs that are currently runn
3 min read
gzexe command in Linux with examples
gzexe command is used to compress executable files and also used to automatically uncompress and execute the files. This utility is very useful on systems having small disk space. This command creates two files. Suppose you run it for a file named grs then it will create two files like: grs~ : Origi
1 min read