How comes running man awk gives No manual entry for awk? I frankly have never personally installed Awk on my Archlinux systems, but I've just found on the current one, the last I installed, there's no man awk, which is strange. man gawk works fine, on the other hand.

Any clues?

Here's the version plus other possibly relevant outputs:

$ awk --version 
GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.0)
Copyright (C) 1989, 1991-2020 Free Software Foundation.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.

$ which awk

$ ls -l $(which awk)
lrwxrwxrwx 1 root root 4 Apr 15 07:38 /usr/bin/awk -> gawk

$ which gawk

From man man, manual pages are usually stored in /usr/share/man.

Since Awk has several implementations (gawk, mawk, ...), it is usually a symlink pointing to the real Awk to be used, in your case, GNU awk. So is its manpage:

$ readlink /usr/share/man/man1/awk.1.gz
$ readlink /etc/alternatives/awk.1.gz

Check if you can find an Awk link under /usr/share/man.

find /usr/share/man/man1 -path '*/awk*'
  • If yes, it is likely a broken link, in which case you can delete it and create a link to the desired manual page (see below).

  • If not, the link is missing. Somehow you deleted it or it was not shipped. That can probably be fixed by installing the package again. Otherwise, create the symlink manually:

ln -s /usr/share/man/man1/gawk.1.gz /usr/share/man/man1/awk.1.gz
  • Archlinux has no /etc/alternatives. I guess you would have to symlink the gawk man page to ~/.local/share/man/. – ctx Sep 6 '20 at 16:03
  • I fixed by (re)installing awk. – Enlico Sep 18 '20 at 6:37

The awk man page is in the man-pages package:

% pacman -Qo /usr/share/man/man1/awk.1p.gz
/usr/share/man/man1/awk.1p.gz is owned by man-pages 5.07-2

You have to explicitly install this package:

% pacman -Qi man-pages
Name            : man-pages
Version         : 5.07-2
Description     : Linux man pages
Architecture    : any
URL             : https://www.kernel.org/doc/man-pages/
Licenses        : GPL  custom
Groups          : None
Provides        : None
Depends On      : None
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 5.61 MiB
Packager        : Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
Build Date      : So 09 Aug 2020 17:54:00
Install Date    : Sa 22 Aug 2020 01:56:46
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature
  • I am not sure this is the problem since OP does have Gawk manual page. But this is helpful. – Quasímodo Sep 6 '20 at 14:36
  • 1
    Note that the awk(1p) manual page is not the same as the gawk(1) or nawk(1) pages. – JdeBP Sep 6 '20 at 14:37
  • Complementing JdeBP's comment, p subsection is for POSIX specifications, which (I'd say) can be more rough to understand than ordinary manual pages. – Quasímodo Sep 6 '20 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.