home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man1 / grep.1 < prev    next >
Encoding:
Text File  |  1975-06-26  |  1.2 KB  |  65 lines

  1. .th GREP I 5/15/74
  2. .sh NAME
  3. grep \*- search a file for a pattern
  4. .sh SYNOPSIS
  5. .bd grep
  6. [
  7. .bd \*-v
  8. ] [
  9. .bd \*-b
  10. ] [
  11. .bd \*-c
  12. ] [
  13. .bd \*-n
  14. ] expression [ file ] ...
  15. .sh DESCRIPTION
  16. .it Grep
  17. searches the input files
  18. (standard input default)
  19. for lines matching the
  20. regular expression.
  21. Normally, each line found
  22. is copied to the standard output.
  23. If the
  24. .bd \*-v
  25. flag is used,
  26. all lines but those matching
  27. are printed.
  28. If the
  29. .bd \*-c
  30. flag is used,
  31. only a count of matching lines is printed.
  32. If the
  33. .bd \*-n
  34. flag is used,
  35. each line is preceded
  36. its relative line number in the file.
  37. If the
  38. .bd \*-b
  39. flag is used,
  40. each line is preceded by the block number
  41. on which it was found.
  42. This is sometimes useful in locating
  43. disk block numbers by context.
  44. .s3
  45. In all cases the file name is shown if there is more than one input file.
  46. .s3
  47. For a complete description
  48. of the regular expression,
  49. see ed (I).
  50. Care should be taken when
  51. using the characters
  52. $ * [ ^ | ( ) and \\ in the regular
  53. expression as they are
  54. also meaningful to the Shell.
  55. It is generally necessary to enclose the
  56. entire
  57. .it expression
  58. argument in quotes.
  59. .sh "SEE ALSO"
  60. ed (I), sh (I)
  61. .sh BUGS
  62. Lines
  63. are limited to 256 characters;
  64. longer lines are truncated.
  65.