troff is a document processing system developed by AT&T for the Unix operating system. The troff typesetting system includes sets of commands called macros that are run before starting to process the document.
Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | No |
Requirements | man/nroff |
Time | N/A |
Option #1: Use man command
The syntax is:
man ./file-name man $HOME/foo.1 man ~/foo.1 man /path/to/foo.1 man /path/to/your-man-page-here
Option #2: Use nroff command
The nroff script emulates the nroff command using groff and the syntax is:
nroff -man foo.1 nroff -man $HOME/foo.1 nroff -man /path/to/foo.1 nroff -man /path/to/your-man-page-here
Option #3: Set MANPATH shell variable
The man command searches the environment variable MANPATH. It is a colon-seperated list of directories like the PATH variable for man pages. To see current man page path, run:
$ manpath
Sample outputs:
/usr/local/share/man:/usr/share/man/overrides:/usr/share/man/en:/usr/share/man
man command uses a sophisticated method of finding manual page files, based on the invocation options and environment variables, the /etc/man.config configuration file, and some built in conventions and heuristics. If MANPATH is set, man uses it as the path to search for manual page files. It overrides the configuration file and the automatic search path, but is overridden by the -M invocation option.
Example
Type the following command
$ export MANPATH="$(manpath):/path/to/your/man1/"
$ man 1 foo
See also
- HowTo: Linux / UNIX Create a Manpage
- nroff, manpath, and man command man pages.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 1 comment... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |