GNU/Linux >> LINUX-Kenntnisse >  >> Ubuntu

Wie finde ich die erforderlichen Informationen beim Menschen?

Für diese Frage gibt es hier bereits Antworten :Wie kann ich innerhalb einer Manpage suchen?

(4 Antworten)
Wie erhalte ich Hilfe zu Terminalbefehlen?

(9 Antworten)
Vor 3 Jahren geschlossen.

Der man Befehl bringt ein nettes Handbuch für viele Programme, aber wie kann ich es effektiver verwenden? Zum Beispiel man gcc bringt:

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

Aber was ist, wenn ich nur einen Teil davon benötige? Was ist der beste Weg, um zu dem Abschnitt zu springen, in dem -Idir beschrieben wird, zum Beispiel?

Akzeptierte Antwort:

Suche den man Seite durch Drücken von / und die Suchzeichenfolge

man verwendet den Viewer less standardmäßig. Sie können in less suchen durch Drücken von / (Schrägstrich) und fügen Sie dann die Suchzeichenfolge hinzu, in Ihrem Beispiel -Idir

GCC(1)                                GNU                               GCC(1)

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.

DESCRIPTION
       When you invoke GCC, it normally does preprocessing, compilation,
       assembly and linking.  The "overall options" allow you to stop this
       process at an intermediate stage.  For example, the -c option says not
       to run the linker.  Then the output consists of object files output by
       the assembler.

/-Idir

Drücken Sie die Enter Schlüssel, und erhalten Sie die erste Übereinstimmung.

Drücken Sie / (Schrägstrich) und die Enter erneut drücken, wiederholen, bis Sie den gewünschten Abschnitt gefunden haben. Sie können auch n drücken für das nächste Spiel.

       -Idir
           Add the directory dir to the head of the list of directories to be
           searched for header files.  This can be used to override a system
           header file, substituting your own version, since these directories
           are searched before the system header file directories.  However,
           you should not use this option to add directories that contain
           vendor-supplied system header files (use -isystem for that).  If
           you use more than one -I option, the directories are scanned in
           left-to-right order; the standard system directories come after.

           If a standard system include directory, or a directory specified
           with -isystem, is also specified with -I, the -I option is ignored.
           The directory is still searched but as a system directory at its
           normal position in the system include chain.  This is to ensure
           that GCC's procedure to fix buggy system headers and the ordering
           for the "include_next" directive are not inadvertently changed.  If
           you really need to change the search order for system directories,
           use the -nostdinc and/or -isystem options.

       -iplugindir=dir
           Set the directory to search for plugins that are passed by
           -fplugin=name instead of -fplugin=path/name.so.  This option is not
           meant to be used by the user, but only passed by the driver.

 Manual page gcc(1) line 10179 (press h for help or q to quit)

Drücken von h gibt einen schönen Überblick über die verfügbaren Befehle.

                   SUMMARY OF LESS COMMANDS

      Commands marked with * may be preceded by a number, N.
      Notes in parentheses indicate the behavior if N is given.
      A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.

  h  H                 Display this help.
  q  :q  Q  :Q  ZZ     Exit.
 ---------------------------------------------------------------------------

                           MOVING

  e  ^E  j  ^N  CR  *  Forward  one line   (or N lines).
  y  ^Y  k  ^K  ^P  *  Backward one line   (or N lines).
  f  ^F  ^V  SPACE  *  Forward  one window (or N lines).
  b  ^B  ESC-v      *  Backward one window (or N lines).
  z                 *  Forward  one window (and set window to N).
  w                 *  Backward one window (and set window to N).
  ESC-SPACE         *  Forward  one window, but don't stop at end-of-file.
  d  ^D             *  Forward  one half-window (and set half-window to N).
  u  ^U             *  Backward one half-window (and set half-window to N).
  ESC-)  RightArrow *  Left  one half screen width (or N positions).
  ESC-(  LeftArrow  *  Right one half screen width (or N positions).
  F                    Forward forever; like "tail -f".
  ESC-F                Like F but stop when search pattern is found.
  r  ^R  ^L            Repaint screen.
  R                    Repaint screen, discarding buffered input.
        ---------------------------------------------------
        Default "window" is the screen height.
        Default "half-window" is half of the screen height.
 ---------------------------------------------------------------------------

                          SEARCHING

  /pattern          *  Search forward for (N-th) matching line.
  ?pattern          *  Search backward for (N-th) matching line.
  n                 *  Repeat previous search (for N-th occurrence).
  N                 *  Repeat previous search in reverse direction.
  ESC-n             *  Repeat previous search, spanning files.
  ESC-N             *  Repeat previous search, reverse dir. & spanning files.
  ESC-u                Undo (toggle) search highlighting.
  &pattern          *  Display only matching lines
        ---------------------------------------------------
        A search pattern may be preceded by one or more of:
        ^N or !  Search for NON-matching lines.
        ^E or *  Search multiple files (pass thru END OF FILE).
        ^F or @  Start search at FIRST file (for /) or last file (for ?).
        ^K       Highlight matches, but don't move (KEEP position).
        ^R       Don't use REGULAR EXPRESSIONS.
 ---------------------------------------------------------------------------
HELP -- Press RETURN for more, or q when done

Weitere Einzelheiten zu „Hilfstools“ finden Sie unter folgendem Link

Verwandte:Kann die Sprache in Kubuntu 19.04 nicht wieder auf Englisch geändert werden?

Wie erhalte ich Hilfe zu Terminalbefehlen?


Ubuntu
  1. So finden Sie heraus, was ein Linux-Befehl tut

  2. Wie installiere ich gcc 4.7?

  3. Wie finde ich die USB-Hub-Geschwindigkeit?

  4. Wie finde ich Dateien in einem bestimmten Sektor?

  5. Wie finde ich Informationen über den Arbeitsspeicher?

So überprüfen oder finden Sie CPU-Informationen in Linux

So überprüfen Sie die GCC-Version in Ubuntu

So finden Sie die Ubuntu-Version

So installieren Sie GCC unter Ubuntu 20.04 LTS

So installieren Sie GCC unter Linux Mint 20

So installieren Sie den GCC-Compiler unter Ubuntu 20.04