View the Most Wanted LQ Wiki articles.    
LinuxQuestions.org > Linux Wiki > Rev

From LQWiki

Jump to: navigation, search

rev is the same as cat, only rev shows characters in reverse. Imagine a file foo that contains:

hello
world

rev foo will print:

olleh
dlrow

to print lines in reverse you can use tac, to print both lines and characters in reverse, for example, use:

tac foo | rev

Provided by

Most (all?) Linux distributions incorporate this from the GNU Coreutils: and use its man page

Related Commands

These all relate to the output or processing of entire files

  • cat -- concatenate files into a single result.
  • tac -- line-reversed cat
  • nl -- output with line numbers
  • od -- dump in octal and other character representations.
  • base64 -- Encode in printable characters.


Personal tools
Sponsored Links