rev(1)

rev1

Reverse lines of a file

Usage

rev [file ...]

Overview

The rev utility copies the specified files to the standard output, reversing the order of characters in every line. If no files are specified, the standard input is read.

Examples

Reverse the text from stdin:

$ echo -e "reverse \t these\ntwo lines" | rev
eseht    esrever
senil owt

Releases

87 releases since FreeBSD 2.0.5-RELEASE; the text changed 37 times.

  1. 2.0.5–2.2.2
  2. 2.2.5–3.5.1
  3. 4.0–4.2
  4. 4.3–4.11
  5. 5.0–6.3
  6. 6.4
  7. 7.0
  8. 7.1
  9. 7.2
  10. 7.3
  11. 7.4
  12. 8.0
  13. 8.1
  14. 8.2
  15. 8.3
  16. 8.4
  17. 9.0
  18. 9.1
  19. 9.2
  20. 9.3
  21. 10.0
  22. 10.1
  23. 10.2
  24. 10.3
  25. 10.4
  26. 11.0
  27. 11.1
  28. 11.2
  29. 11.3
  30. 11.4
  31. 12.0
  32. 12.1
  33. 12.2
  34. 12.3
  35. 12.4
  36. 13.0–13.2
  37. 13.3–14.5
  38. 15.0–16.0

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.