Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
4
votes
4
answers
1537
views
Can I make my own example-containing man page?
I'd like to have an additional "man" page for grep, containing examples that I would use (but don't always remember).
I'd like to have an additional "man" page for grep, containing examples that I would use (but don't always remember).
Mike
(271 rep)
Jul 11, 2025, 06:17 PM
• Last activity: Jul 14, 2025, 01:50 PM
4
votes
1
answers
606
views
Make man pages narrow and centered in the terminal
I have a wide monitor and the terminal opened at fullscreen. I want man pages to be narrowed to, say, 100 characters wide, and centered on the screen, like in emacs olivetti mode: https://github.com/rnkn/olivetti. How can I do that?
I have a wide monitor and the terminal opened at fullscreen. I want man pages to be narrowed to, say, 100 characters wide, and centered on the screen, like in emacs olivetti mode: https://github.com/rnkn/olivetti .
How can I do that?
krvkir
(213 rep)
Oct 27, 2018, 12:40 PM
• Last activity: Jun 27, 2025, 02:15 PM
-3
votes
1
answers
113
views
bash -n is a not documented in manpages or info documents
Even though bash -n is a valid and widely used option, some manpages don't clearly document it in the bash options section, even though it is implemented. It's also not in the GNU Bash Reference Manual – Invoking Bash section: https://www.gnu.org/software/bash/manual/html_node/Invoking-Bash.html I c...
Even though bash -n is a valid and widely used option, some manpages don't clearly document it in the bash options section, even though it is implemented. It's also not in the GNU Bash Reference Manual – Invoking Bash section: https://www.gnu.org/software/bash/manual/html_node/Invoking-Bash.html
I can understand that the Bash man page (man bash) doesn't explicitly list -n as a command-line option for Bash itself but I would expect
info bash
to include it since I was under the impression that info documents are much more comprehensive than linux manpages. This omission is confusing and frustrating.
The only place it's mentioned is in a stackoverflow answer: https://stackoverflow.com/a/171932
bit
(1176 rep)
Apr 18, 2025, 08:09 PM
• Last activity: Apr 20, 2025, 05:36 AM
28
votes
6
answers
5653
views
The UNIX and Linux SysAdm Handbook: Why are cached man pages a "security risk"?
The *UNIX and Linux System Administration Handbook* says: > man maintains a cache of formatted pages in /var/cache/man or > /usr/share/man if the appropriate directories are writable; however, > this is a security risk. Most systems preformat the man pages once at > installation time (see catman) or...
The *UNIX and Linux System Administration Handbook* says:
> man maintains a cache of formatted pages in /var/cache/man or
> /usr/share/man if the appropriate directories are writable; however,
> this is a security risk. Most systems preformat the man pages once at
> installation time (see catman) or not at all.
What is the "security risk(s)" here?
There is the obvious security risk that someone can alter the man pages to trick a (novice) user into running something undesirable, as pointed out by [Ulrich Schwartz in their answer](https://unix.stackexchange.com/a/652326/) , but I am looking for other ways this could be exploited. Thanks!
puwlah
(529 rep)
Jun 1, 2021, 11:16 AM
• Last activity: Apr 2, 2025, 11:33 AM
27
votes
4
answers
3066
views
Why didn't GNU Info succeed man?
As per my knowledge/understanding both help and man came at the same time or have very little time difference between them. Then GNU Info came in and from what I have seen is much more verbose, much more detailed and arguably much better than what man is. Many entries even today in man are cryptic....
As per my knowledge/understanding both help and man came at the same time or have very little time difference between them. Then GNU Info came in and from what I have seen is much more verbose, much more detailed and arguably much better than what man is. Many entries even today in man are cryptic.
I have often wondered why Info which is superior to man in many ways didn't succeed man at all. I still see people producing man pages than info pages. Was it due to not helpful tools for info? Something in the licenses of the two? Or some other factor which didn't get info the success it richly deserved?
I did see a few questions on unix stackexchange notably https://unix.stackexchange.com/questions/77514/what-is-gnu-info-for and https://unix.stackexchange.com/questions/19451/difference-between-help-info-and-man-command/159817 among others.
shirish
(12954 rep)
Oct 7, 2014, 05:11 PM
• Last activity: Mar 19, 2025, 11:10 PM
12
votes
2
answers
1626
views
man pages have odd characters in the output
I am using Fedora and Gnome. I use GNOME Terminal and I am experiencing some odd output characters which seem to surround certain keywords on output. 1mNAME0m sync - Synchronize cached writes to persistent storage 1mSYNOPSIS0m 1msync 22m[4mOPTION24m] [4mFILE24m]... 1mDESCRIPTION0m Synchronize cached...
I am using Fedora and Gnome. I use GNOME Terminal and I am experiencing some odd output characters which seem to surround certain keywords on output.
1mNAME0m
sync - Synchronize cached writes to persistent storage
1mSYNOPSIS0m
1msync 22m[4mOPTION24m] [4mFILE24m]...
1mDESCRIPTION0m
Synchronize cached writes to persistent storage
If one or more files are specified, sync only them, or their containing file systems.
1m-d22m, 1m--data0m
As can be seen a
1m
, 22m
, 4m
, 24m
are used as (frustrating) highlighters.
I believe it is possibly 'end of line' or some other special characters. I am using Unicode UTF-8 encoding within the terminal preferences.
How can I get them removed?
Robert D Weir
(127 rep)
Feb 23, 2021, 09:01 PM
• Last activity: Jan 17, 2025, 09:15 PM
4
votes
2
answers
344
views
Linux mint man pages require sudo when pager is neovim
If I `sudo man` it works fine, otherwise I'm getting ``` ~$ man ls fuse: mount failed: Permission denied Cannot mount AppImage, please check your FUSE setup. You might still be able to extract the contents of this AppImage if you run it with the --appimage-extract option. See https://github.com/AppI...
If I
sudo man
it works fine, otherwise I'm getting
~$ man ls
fuse: mount failed: Permission denied
Cannot mount AppImage, please check your FUSE setup.
You might still be able to extract the contents of this AppImage
if you run it with the --appimage-extract option.
See https://github.com/AppImage/AppImageKit/wiki/FUSE
for more information
open dir error: No such file or directory
for reference, setting the MANPAGER
as per neovim help
export MANPAGER='nvim +Man!'
:Man
command works fine from inside nvim.
sudavid4
(181 rep)
Jun 6, 2020, 11:15 AM
• Last activity: Jan 10, 2025, 10:51 AM
11
votes
1
answers
13534
views
Changing default (man) pager on Solaris 10
I'm working on Solaris 10, using bash. Want to change default pager from "more" to "less" (because "less is more" :). Tried to do the following: PAGER=less PS. When I do it in csh via setenv PAGER less then it works
I'm working on Solaris 10, using bash. Want to change default pager from "more" to "less" (because "less is more" :). Tried to do the following:
PAGER=less
PS. When I do it in csh via
setenv PAGER less
then it works
stevica
(183 rep)
Nov 8, 2018, 09:56 AM
• Last activity: Jan 8, 2025, 02:05 PM
12
votes
2
answers
933
views
Debian Bookworm always sets `COLUMNS` to be a little less than the actual terminal width
On Debian Bookworm, the `$COLUMNS` bash variable is always a little smaller than the actual terminal width. This leaves a little space on the right side whenever I run a program that runs through `less`, such as `man`, `git help commit`, etc. Here's a screenshot of the output of `man bash`, note the...
On Debian Bookworm, the
However,
$COLUMNS
bash variable is always a little smaller than the actual terminal width. This leaves a little space on the right side whenever I run a program that runs through less
, such as man
, git help commit
, etc. Here's a screenshot of the output of man bash
, note the margin on the right side:

$COLUMNS
on my Fedora is set to the full width of the terminal emulator.
How can I make the $COLUMNS
variable always equal to the full width of the terminal emulator?
Since there are so many programs that would go through the pager, I prefer not using a solution that sets COLUMNS=
before a particular program launches.
The solution should also be able to change $COLUMNS
when the terminal window resizes, like what bash does by default.
xuhdev
(597 rep)
Dec 25, 2024, 05:42 AM
• Last activity: Jan 3, 2025, 06:40 AM
52
votes
3
answers
5062
views
Purpose of “ASCII text, with overstriking” file format
After downloading the source code for Bash, I was browsing through the `doc` directory and came across the following files: * [`bash.1`](http://git.savannah.gnu.org/cgit/bash.git/tree/doc/bash.1) is a regular [troff](https://en.wikipedia.org/wiki/Troff) file used to build the *man page*. * [`bash.0`...
After downloading the source code for Bash, I was browsing through the
doc
directory and came across the following files:
* [bash.1
](http://git.savannah.gnu.org/cgit/bash.git/tree/doc/bash.1) is a regular [troff](https://en.wikipedia.org/wiki/Troff) file used to build the *man page*.
* [bash.0
](http://git.savannah.gnu.org/cgit/bash.git/tree/doc/bash.0) is like a plain text version of the man page – only that it has the [^H
backspace control character](https://en.wikipedia.org/wiki/Backspace#.5EH) liberally distributed throughout it.
These control characters are not displayed in the representation provided by the Git web interface but the [actual file can be downloaded](http://git.savannah.gnu.org/cgit/bash.git/plain/doc/bash.0) and examined in text editor such as Vim.
Running the file
command on bash.0
prints the following output:
bash.0: ASCII text, with overstriking
I’ve never come across this file format before and I was wondering what its purpose is and how it’s used. Searching the Web for the phrase *“ASCII text, with overstriking”* hasn’t been very enlightening.
Anthony Geoghegan
(13511 rep)
Apr 6, 2016, 10:36 AM
• Last activity: Dec 11, 2024, 08:46 PM
2
votes
1
answers
454
views
Encoding problems with German man pages
On the machine I am working on I have English man pages under `/usr/share/man/`and German ones under `/usr/share/man/de`. The former are encoded with `us-ascii`, the latter ones with `utf-8`. Unfortunately some special characters (Umlaute) in the German man pages are not displayed properly when call...
On the machine I am working on I have English man pages under
/usr/share/man/
and German ones under /usr/share/man/de
. The former are encoded with us-ascii
, the latter ones with utf-8
.
Unfortunately some special characters (Umlaute) in the German man pages are not displayed properly when calling $ man some_command_with_german_manpage
with my current settings.
What are the correct settings in /etc/man.conf
to resolve this issue? At the moment I have the following (omitting lines that I do think are not relevant):
TROFF /usr/bin/groff -Tps -mandoc
NROFF /usr/bin/nroff -Tps -mandoc -c
JNROFF /usr/bin/groff -Tnippon -mandoc
EQN /usr/bin/geqn -Tps
NEQN /usr/bin/geqn -Tlatin1
JNEQN /usr/bin/geqn -Tnippon
TBL /usr/bin/gtbl
# COL /usr/bin/col
REFER /usr/bin/refer
PIC /usr/bin/pic
VGRIND
GRAP
PAGER /usr/bin/less -isR
BROWSER /usr/bin/lynx
HTMLPAGER /usr/bin/lynx -dump
CAT /bin/cat
$ locale
returns the following:
LANG=de_DE.utf8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="de_DE.utf8"
LC_TIME="de_DE.utf8"
LC_COLLATE="de_DE.utf8"
LC_MONETARY="de_DE.utf8"
LC_MESSAGES="de_DE.utf8"
LC_PAPER="de_DE.utf8"
LC_NAME="de_DE.utf8"
LC_ADDRESS="de_DE.utf8"
LC_TELEPHONE="de_DE.utf8"
LC_MEASUREMENT="de_DE.utf8"
LC_IDENTIFICATION="de_DE.utf8"
LC_ALL=
S F
(183 rep)
Jul 6, 2018, 12:11 PM
• Last activity: Dec 5, 2024, 11:11 AM
4
votes
5
answers
4650
views
How can I `man print`?
Where can I find more information about the command(?) `print` since I don't receive a result when I input `man print`? For example, in the `zsh` I can do the following: $ print "Hello, world\!" Hello, world! I've seen `print -P foo` and `print -n bar` used among other flags and have no idea what th...
Where can I find more information about the command(?)
print
since I don't receive a result when I input man print
? For example, in the zsh
I can do the following:
$ print "Hello, world\!"
Hello, world!
I've seen print -P foo
and print -n bar
used among other flags and have no idea what they mean nor do I know where to look for further information. So we have two questions really:
1. Where does print
come from and where can I find documentation for it?
2. Where does one find documentation for similar items that are not to be found in the man
pages?
NOTE: For clarification, I'm not trying to print a sheet of paper. I am also aware of printf
, which allows for formatted output and has a man page.
Chauncey Garrett
(449 rep)
Jun 20, 2013, 04:39 AM
• Last activity: Nov 20, 2024, 08:10 AM
21
votes
2
answers
13031
views
Export a man page in pdf
Doing `man -t man > man.ps` will export the man page for man in postscript. How can I export it in PDF? I have gone through the manuals and learnt about the `-T` option but it's a bit unclear to me.
Doing
man -t man > man.ps
will export the man page for man in postscript.
How can I export it in PDF?
I have gone through the manuals and learnt about the -T
option but it's a bit unclear to me.
Neo_Returns
(589 rep)
May 19, 2018, 07:57 AM
• Last activity: Oct 20, 2024, 09:19 AM
7
votes
4
answers
2205
views
Query Linux man page for certain flag
I often open man pages of a certain CLI tool only to check a particular flag, e.g. `man iptables` to check `-t` flag. Is there any tool that simplifies it? I could of course write a simple function in Bash grepping the contents of a man pages but I am looking for something that uses the structure of...
I often open man pages of a certain CLI tool only to check a particular flag, e.g.
man iptables
to check -t
flag.
Is there any tool that simplifies it? I could of course write a simple function in Bash grepping the contents of a man pages but I am looking for something that uses the structure of man pages to find exactly what I want (i.e. description of a certain flag).
syntagma
(12801 rep)
Aug 11, 2016, 09:50 AM
• Last activity: Oct 19, 2024, 04:18 PM
8
votes
1
answers
882
views
Customize the man command's status prompt to show percentage read
I like the man command's status prompt to be customized. The default as picked from its own man page is like this, `Manual page name(sec) line x` But, having it show me the percentage of contents read is my preference. So I set the environment variable that controls the prompt, `MANLESS` as, `export...
I like the man command's status prompt to be customized. The default as picked from its own man page is like this,
Manual page name(sec) line x
But, having it show me the percentage of contents read is my preference. So I set the environment variable that controls the prompt, MANLESS
as,
export MANLESS='?pt%pt \%: '
The prompt is empty. I put -P in the front as,
export MANLESS='-P?pt%pt \%: '
No progress, now the prompt only contains -P
. So, I directly set it for every invocation using the -r
option,
man -r '?pt%pt \%: ' less
That too didn't help. But, this same prompt when set to LESS env. variable as
export LESS="-P?pt%pt \%"
Every direct invocation of less is showing the desired prompt as
x %
.
It is only when less pager is called through man, it does not work.
Saravana
(193 rep)
Oct 13, 2024, 04:42 PM
• Last activity: Oct 14, 2024, 05:00 PM
2011
votes
3
answers
561825
views
Why does man print "gimme gimme gimme" at 00:30?
We've noticed that some of our automatic tests fail when they run at 00:30 but work fine the rest of the day. They fail with the message ``` gimme gimme gimme ``` in `stderr`, which wasn't expected. Why are we getting this output?
We've noticed that some of our automatic tests fail when they run at 00:30 but work fine the rest of the day. They fail with the message
gimme gimme gimme
in stderr
, which wasn't expected. Why are we getting this output?
Jaroslav Kucera
(10882 rep)
Nov 20, 2017, 02:19 PM
• Last activity: Oct 7, 2024, 01:45 PM
42
votes
2
answers
4395
views
Why do Unix man pages use double backticks in place of double quotes?
I've noticed that man pages and other documents formatted by Unix utilities often use double backticks ` `` ` followed by double single quotes `''` to wrap quoted phrases instead of the double quote character `"`. Single quotes are similarly replaced. Why is this? Here are a couple examples, from th...
I've noticed that man pages and other documents formatted by Unix utilities often use double backticks
followed by double single quotes ''
to wrap quoted phrases instead of the double quote character "
. Single quotes are similarly replaced. Why is this?
Here are a couple examples, from the man page for grep
:
To find all occurrences of the pattern `.Pp' at the beginning of a line:
$ grep '^\.Pp' myfile
The apostrophes ensure the entire expression is evaluated by grep instead
of by the user's shell. The caret `^' matches the null string at the
beginning of a line, and the \' escapes the
.', which would otherwise match
any character.
The grep utility is compliant with the IEEE Std 1003.1-2008 (``POSIX.1'')
specification.
ecmendenhall
(523 rep)
Apr 28, 2013, 07:08 PM
• Last activity: Aug 26, 2024, 02:30 PM
6
votes
1
answers
372
views
Is groff ignoring `.nh` command?
For a man page written in POD (perlpod) I had the effect that the SYNOPSIS was left-adjusted on the text terminal, but the PostScript output (read: troff) adjusted the text to both borders. So I tried to embed formatting commands in the POD source. However, even when specifying `.nh` some words like...
For a man page written in POD (perlpod) I had the effect that the SYNOPSIS was left-adjusted on the text terminal, but the PostScript output (read: troff) adjusted the text to both borders.
So I tried to embed formatting commands in the POD source.
However, even when specifying
WHen converting that manual page using
Programs being used are perl 5.18.2, groff-1.22, both from SLES12 SP5.
.nh
some words like "[--[no-]check-grace-logins]" were hyphenated at a minus.
That made me wonder whether the man -l
command disobeys the .nh
command.
The manual page for roff(7) says:
> .nh No hyphenation.
Here is the relevant part of the roff man page:
~~~lang-roff
.\" ========================================================================
.\"
.IX Title "LDAP-USER-CHECK 8"
.TH LDAP-USER-CHECK 8 "2024-08-14" "0.0.0.0.20n" "System Administration"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
ldap\-user\-check \- check LDAP account status
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.\" BEGIN roff
.\" save adjustment, then left-adjust
.ds _A \n[.j]
.ad l
.\" save hyphenation, then disable
.ds _H \n[.hy]
.nh
.\" END roff
\&\fBldap-user-check\fR
[\fB\-\-account\-context=\fR\fIcontext\fR]
[\fB\-\-account\-filter=\fR\fIfilter\fR]
[\fB\-\-add\-notification\-bcc\-address=\fR\fIemail-spec\fR]...
[\fB\-\-add\-notification\-cc\-address=\fR\fIemail-spec\fR]...
[\fB\-\-default\-default\-ppolicy=\fR\fIdn\fR]
[\fB\-\-default\-language=\fR\fIlang\fR]
[\fB\-\-default\-notification\-email\-address=\fR\fIemail-spec\fR]...
[\fB\-\-ca\-certs\-path=\fR\fIpath\fR]
[\fB\-\-\fR[\fBno\-\fR]\fBcheck-auth-failure\fR]
[\fB\-\-\fR[\fBno\-\fR]\fBcheck-grace-logins\fR]
[\fB\-\-\fR[\fBno\-\fR]\fBcheck-inconsistent-accounts\fR]
[\fB\-\-\fR[\fBno\-\fR]\fBcheck-locked-accounts\fR]
[\fB\-\-\fR[\fBno\-\fR]\fBcheck-password-policy\fR]
[\fB\-\-\fR[\fBno\-\fR]\fBcheck-pp-override\fR]
[\fB\-\-\fR[\fBno\-\fR]\fBcheck-shadow-password\fR]
[\fB\-\-credentials\-file\-name=\fR\fIfilename\fR]
[\fB\-\-instance\-string=\fR\fIinstance\fR]
[\fB\-\-ldap\-size\-limit=\fR\fInumber\fR]
\&\fB\-\-ldap\-suffix=\fR\fIsuffix\fR
[\fB\-\-ldap\-time\-limit=\fR\fInumber\fR]
\&\fB\-\-ldap\-uri=\fR\fI\s-1URI\s0\fR
\&\fB\-\-notification\-template=\fR\fIfilename\fR
[\fB\-\-override\-default\-ppolicy=\fR\fIdn\fR]
[\fB\-\-override\-expiration\-warning\-time=\fR\fInumber\fR]
[\fB\-\-override\-from\-email\-address=\fR\fIemail-spec\fR]
[\fB\-\-override\-notification\-email\-address=\fR\fIemail-spec\fR]...
[\fB\-\-ppolicy\-context=\fR\fIcontext\fR]
[\fB\-\-set\-notification\-reply\-to\-address=\fR\fIemail-spec\fR]
[\fB\-\-verbosity=\fR\fIlevel\fR]
[\fB\-\-wrap\-template=\fR\fIlen\fR]
.\" BEGIN roff
.\" restore saved hyphenation and adjustment
.hy \*(_H
.ad \*(_A
.\" END roff
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
~~~
And here is what I see on a 80-character wide terminal:

groff -man -Tps
the .nh
seems to be ignored as well:

U. Windl
(1715 rep)
Aug 14, 2024, 01:02 PM
• Last activity: Aug 16, 2024, 12:16 PM
1
votes
1
answers
162
views
Manpage of 'regex(7)', from the shell
Today I have read two answers about which regular expressions are supported by `less`: - Kusalananda mentioned `re_format(7)` and referenced its manpage as `man 7 re_format`. ``` RE_FORMAT(7) Miscellaneous Information Manual RE_FORMAT(7) NAME re_format – POSIX 1003.2 regular expressions DESCRIPTION...
Today I have read two answers about which regular expressions are supported by
less
:
- Kusalananda mentioned re_format(7)
and referenced its manpage as man 7 re_format
.
RE_FORMAT(7) Miscellaneous Information Manual RE_FORMAT(7)
NAME
re_format – POSIX 1003.2 regular expressions
DESCRIPTION
Regular expressions (“REs”), as defined in IEEE Std 1003.2 (“POSIX.2”),
- ilkkachu mentioned regex(7)
and referenced its manpage by providing a link to a web page instead.
regex(7) Miscellaneous Information Manual regex(7)
NAME
regex - POSIX.2 regular expressions
DESCRIPTION
Regular expressions ("RE"s), as defined in POSIX.2,
I try to figure out how to open the regex(7)
manpage from the shell instead of reading it on the web.
man regex7
, man regex(7)
, man 7 regex
, man7 regex
just don't work, and man regex
leads to the regex(3)
manpage instead.
jsx97
(1347 rep)
Aug 14, 2024, 07:41 PM
• Last activity: Aug 15, 2024, 06:48 AM
68
votes
2
answers
24847
views
Documentation on LESS_TERMCAP_* variables?
I see these [pretty colors in manpages](https://unix.stackexchange.com/questions/119/colors-in-man-pages) viewed with less when setting a bunch of these variables. What do they mean, where is the documentation? Is this interpreted by less or termcap? ### screenshot [![ss of man page][1]][1] [1]: htt...
I see these [pretty colors in manpages](https://unix.stackexchange.com/questions/119/colors-in-man-pages) viewed with less when setting a bunch of these variables. What do they mean, where is the documentation? Is this interpreted by less or termcap?
### screenshot

anselm
(783 rep)
Jan 10, 2014, 11:10 AM
• Last activity: Aug 13, 2024, 11:24 AM
Showing page 1 of 20 total questions