We can search whole man page using man -wK
.
We can get the git subcommands using git help -a
. We can get common git guides using git help -g
.
For an overview of the system we can use git help git
. To check the man page of a particular subcommand we can use, for example git help add
. To check the man page of a particular guides we can use, for example git help cli
.
I am interested to search the whole git (its subcommands, guides and overview man pages).
How can I do that?
I usually:
Documentation
foldergit grep "The-term-I-want-know-about"
That will search in all:
For commands (not guides):
git --list-cmds=main,builtins | xargs -n 1 -I {} man git {} | cat | less
You could also expand that list.
For guides:
git --list-cmds=list-guide | xargs -n 1 -I {} man git{} | cat | less
That’s a separate invocation since those are spelled e.g. giteveryday
.
If you want both of them at the same time:
cmds=$(mktemp)
git --list-cmds=main,builtins | xargs -n 1 -I {} man git {} | cat > $cmds
guides=$(mktemp)
git --list-cmds=list-guide | xargs -n 1 -I {} man git{} | cat > $guides
cat $cmds $guides | less
rm $cmds $guides
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With