tail 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. .TH TAIL 1
  2. .SH NAME
  3. tail \- deliver the last part of a file
  4. .SH SYNOPSIS
  5. .B tail
  6. [
  7. .BR +- \fInumber\fP[ lbc ][ rf ]
  8. ]
  9. [
  10. .I file
  11. ]
  12. .PP
  13. .B tail
  14. [
  15. .B -fr
  16. ]
  17. [
  18. .B -n
  19. .I nlines
  20. ]
  21. [
  22. .B -c
  23. .I nbytes
  24. ]
  25. [
  26. .I file
  27. ]
  28. .SH DESCRIPTION
  29. .I Tail
  30. copies the named file to the standard output beginning
  31. at a designated place.
  32. If no file is named, the standard input is copied.
  33. .PP
  34. Copying begins at position
  35. .BI + number
  36. measured from the beginning, or
  37. .BI - number
  38. from the end of the input.
  39. .I Number
  40. is counted in lines, 1K blocks or bytes,
  41. according to the appended flag
  42. .LR l ,
  43. .LR b ,
  44. or
  45. .LR c .
  46. Default is
  47. .B -10l
  48. (ten ell).
  49. .PP
  50. The further flag
  51. .L r
  52. causes tail to print lines from the end of the file in reverse order;
  53. .L f
  54. (follow) causes
  55. .IR tail ,
  56. after printing to the end, to keep watch and
  57. print further data as it appears.
  58. .PP
  59. The second syntax is that promulgated by POSIX, where
  60. the
  61. .I numbers
  62. rather than the options are signed.
  63. .SH EXAMPLES
  64. .TP
  65. .B tail file
  66. Print the last 10 lines of a file.
  67. .TP
  68. .B tail +0f file
  69. Print a file, and continue to watch
  70. data accumulate as it grows.
  71. .TP
  72. .B sed 10q file
  73. Print the first 10 lines of a file.
  74. .SH SOURCE
  75. .B /sys/src/cmd/tail.c
  76. .SH BUGS
  77. Tails relative to the end of the file
  78. are treasured up in a buffer, and thus
  79. are limited in length.
  80. .PP
  81. According to custom, option
  82. .BI + number
  83. counts lines from 1, and counts
  84. blocks and bytes from 0.
  85. .PP
  86. .I Tail
  87. is ignorant of UTF.