0

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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
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
/usr/bin/awk

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

$ which gawk
/usr/bin/gawk
Enlico
  • 1,471
  • 16
  • 35

2 Answers2

1

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
/etc/alternatives/awk.1.gz
$ readlink /etc/alternatives/awk.1.gz
/usr/share/man/man1/gawk.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
Quasímodo
  • 18,625
  • 3
  • 35
  • 72
1

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 <[email protected]>
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
ctx
  • 2,404
  • 10
  • 17
  • I am not sure this is the problem since OP does have Gawk manual page. But this is helpful. – Quasímodo Sep 06 '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 06 '20 at 14:37
  • Complementing JdeBP's comment, [p subsection is for POSIX specifications](https://unix.stackexchange.com/a/3587), which (I'd say) can be more rough to understand than ordinary manual pages. – Quasímodo Sep 06 '20 at 14:40