rev(1)

rev1

Reverse lines characterwise

Usage

rev [option] [file ...]

Overview

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

This utility is a line-oriented tool and it uses in-memory allocated buffer for a whole wide-char line. If the input file is huge and without line breaks then allocating the memory for the file may be unsuccessful.

Options

-0, --zero

Zero termination. Use the byte '\0' as line separator.

-h, --help

Display help text and exit.

-V, --version

Display version and exit.

Releases

15 releases since Debian 2.1 (Slink); the text changed 10 times.

  1. 2.1–4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9
  7. 10
  8. 11
  9. 12
  10. 13
  11. Arch

--help since Debian 7 (Wheezy); --version since Debian 7 (Wheezy); --zero since Debian 13 (Trixie); -0 since Debian 13 (Trixie); -V since Debian 7 (Wheezy); -h since Debian 7 (Wheezy).

Reporting bugs

For bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>.

Availability

The rev command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.

From util-linux 2.42.4-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.