The man
command brings up a nice manual for many programs, but how can I use it more effectively? For example man gcc
brings:
NAME
gcc - GNU project C and C++ compiler
SYNOPSIS
gcc [-c|-S|-E] [-std=standard]
[-g] [-pg] [-Olevel]
[-Wwarn...] [-Wpedantic]
[-Idir...] [-Ldir...]
[-Dmacro[=defn]...] [-Umacro]
[-foption...] [-mmachine-option...]
[-o outfile] [@file] infile...
Only the most useful options are listed here; see below for the
remainder. g++ accepts mostly the same options as gcc.
....
many text
But what if I need only some part of it? What is the best way to jump to the section where -Idir
is described, for example?
Best Answer
Search the
man
page by pressing / and the search stringman
is using the viewerless
by default. You can search inless
by pressing / (slash), and then add the search string, in your example-Idir
Press the Enter key, and get the first match.
Press / (slash) and the Enter key again, repeat until you find the section, that you want. You can also press n for the next match.
Pressing h gives a nice overview over the available commands.
You find more details about 'help tools' at the following link
How can I get help on terminal commands?