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

163 releases since Mac OS X 10.0; the text changed 2 times.

  1. 10.0–10.6.8
  2. 10.7–12.2
  3. 12.3–26.5

From text_cmds 199 in macOS 26.5. Parsed by carta from the page's mdoc source.