0

man -k '^printf' lists man pages specifically available for printf utility only, printf(1) and printf(3) in my PC. If you do not mention these signs around printf, the command doesn't work.

I want to make an alias mank for this but I am stuck at the logic.

I want to be able to type mank utility and have the same output as man -k '^utility'.

This way without typing silly symbols, we would get all the man pages available for that utility.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232

1 Answers1

2

Clear the old alias, then make a function, and run it:

unalias mank
mank() { man -k "^$1" ; }
mank printf

Output:

printf (1)           - format and print data
printf (1posix)      - write formatted output
printf (3)           - formatted output conversion
printf (3posix)      - print formatted output
agc
  • 7,223