Print files in reverse with coreutils ‘tac’ and ‘rev’ commands

tac_revSometimes it would be useful to print file contents or output of previously executed command in reverse. There are two little utilities that are part of Linux coreutils: tac and rev.

TAC concatenates and prints files in reverse (last line first). REV reverses lines of a file: it copies the specified files to the standard output, reversing the order of characters in every line.

 
 
» You might also be interested in the following articles:
Linux/Unix coreutils command ‘paste’ to merge lines of files
Manage gzip files on-the-fly (zcommands)
Linux and Open Source News
Sort CLI output by line length
Access to sqlite3 database through perl (script example)



» Want to stay up to date? Subscribe to our E-MAIL or RSS feed!

0 Responses to “Print files in reverse with coreutils ‘tac’ and ‘rev’ commands”


  1. No Comments

Leave a Reply




Friendly Sites:Who is behind Linux Screw?
GeekyBits³ | Bash Cures Cancer | OMG! Ubuntu!
My SysAd Blog | Web Upd8
ZEPY | Linux config Wiki | Planet Sysadmin
a non-geek's linux notes | Linux Today
Linux HOWTOs, Tutorials & Projects with Adam Palmer | LinuxAlt.Com
My name is Artem N. (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››