Seth Woolley's Man Viewer

match(1) - match - searches for patterns in files - man 1 match

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

MATCH(1L)                   Schilys USER COMMANDS                   MATCH(1L)

       match - searches for patterns in(1,8) files

       match [ -option ] pattern [ file(1,n) ...  ]

       Match  searches  the named(5,8) files or standard input (if(3,n) no filenames are
       given) for the occurrences of the given pattern on each line.  The pro-
       gram accepts literal characters or special pattern matching characters.
       All lines that match the pattern are output on  standard  output.   You
       can  only  specify  one pattern string(3,n) for each match, however, you can
       construct an arbitrarily complex string.  When you  do  not  specify  a
       file(1,n), match can be used as a filter(1,3x,3x curs_util) to display desired lines.  Standard
       in(1,8) is used if(3,n) no files are specified.

       -not, -v
              Prints all lines that do not match.

       -i     Ignore the case of letters

       -m     Force not to use the magic(4,5) mode

       -w     Search for pattern as a word

       -x     Display only those lines which match exactly

       -c     Display matching count for each file(1,n)

       -l     Display name of each file(1,n) which matches

       -s     Be silent indicate match in(1,8) exit(3,n,1 builtins) code

       -h     Do not display filenames

       -n     Precede matching lines with line number  (with  respect  to  the
              input file(1,n))

       -b     Precede matching lines with block number

       The following is a table of all the pattern matching characters:

       c      An  ordinary  character  (not one of the special characters dis-
              cussed below) is a one character regular expression that matches
              that character.

       \c     A backslash (\) followed by any special character is a one char-
              acter regular expression  that  matches  the  special  character
              itself. The special characters are:

              ! # % * { } [ ] \ ? ^ $

       !      Logical OR as in(1,8) match this!that!the_other.  You may have to use
              `{}' for precedence grouping.

       #      A hash mark followed by any regular expression matches any  num-
              ber (including zero) occurrences of the regular expression.

       ?      Matches  exactly any one character.  W?  matches Wa, Wb, Wc, W1,
              W2, W3 ...

       *      Matches any number of any character.

       %      Matches exactly nothing. It can be used in(1,8) groups of  ored  pat-
              terns to specify that an empty alternative is possible.

       {}     Curly  brackets  may  be  used  to enclose patterns to specify a
              precedence  grouping,  and  may  be  nested.   {%!{test}}version(1,3,5)
              matches the strings testversion and version.

              A  non empty string(3,n) of characters enclosed in(1,8) square brackets is
              a one character regular expression that matches any one  charac-
              ter  in(1,8)  that  string.   If  however  the first character of the
              string(3,n) is a circumflex (^), the one character expression matches
              any character which is not in(1,8) the string. The ^ has this special
              meaning only if(3,n) it occurs first in(1,8) the string. The minus (-) may
              be used to indicate a range of consecutive ASCII characters; for
              example, [0-9] is equivalent to any one of the  digits.   The  -
              loses  it's special meaning if(3,n) it occurs first (after an initial
              ^, if(3,n) any) or last in(1,8) the string.  The right square bracket  (])
              and  the  backslash  (\)  must be quoted with a backslash if(3,n) you
              want to use it within the string.

       ^      Matches the beginning of a line.

       $      Matches the end of a line. (^*$ matches any entire line)


       grep(1), fgrep(1), egrep(1)

       Even if(3,n) a match occurs more than once per line, the line is output only

       Quote  special  pattern  matching characters to prevent them from being
       expanded by the Command Interpreter.

       The length of the pattern is currently limited to 100 characters.

       This limit is reduced by 38 if(3,n) the -w option is used.

Joerg Schilling                  15. Juli 1988                       MATCH(1L)

References for this manual (incoming links)