logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git/

uniq.1 (1210B)


  1. .\" utils-std: Collection of commonly available Unix tools
  2. .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. .\" SPDX-License-Identifier: MPL-2.0
  4. .Dd 2024-05-02
  5. .Dt UNIQ 1
  6. .Os
  7. .Sh NAME
  8. .Nm uniq
  9. .Nd report or filter out duplicated lines
  10. .Sh SYNOPSIS
  11. .Nm
  12. .Op Fl c Ns | Ns Fl d Ns | Ns Fl u
  13. .Op Fl f Ar field_shift
  14. .Op Fl s Ar byte_shift
  15. .Op Ar input_file Op Ar output_file
  16. .Sh DESCRIPTION
  17. The
  18. .Nm
  19. utility reads
  20. .Ar file1
  21. and
  22. .Ar file2
  23. line-by-line and by default filters out repeating lines.
  24. .Sh OPTIONS
  25. The following options are supported:
  26. .Bl -tag -width Ds
  27. .It Fl c
  28. Prefix lines with how many times they are duplicated.
  29. .It Fl d
  30. Only write duplicated lines (count > 1).
  31. .It Fl f Ar field_shift
  32. Shift the compared line by
  33. .Ar field_shift
  34. amount of fields, where a field is
  35. .Aq blank
  36. separated.
  37. .It Fl s Ar byte_shift
  38. Shift the compared lines by
  39. .Ar byte_shift .
  40. If
  41. .Ar field_shift
  42. was also specified, it provides an additional shift.
  43. .It Fl u
  44. Only write unique lines (count == 1).
  45. .El
  46. .Sh EXIT STATUS
  47. .Ex -std
  48. .Sh STANDARDS
  49. .Nm
  50. should be compliant with the
  51. IEEE Std 1003.1-2024 (“POSIX.1”)
  52. specification.
  53. .Sh AUTHORS
  54. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me