What is the rev
command in Linux?
What is the rev
command?
As the name implies, the rev
command (short for reverse) allows users to reverse a line of characters or a file.
How is the rev
command used?
The rev
command is typically supplied a string of characters or a file input.
rev
with a file
If a file named example.txt
contains:
|
|
and rev
is supplied example.txt
, then the output will showcase the reversed result.
|
|
rev
with standard input
rev
accepts standard input by default.
|
|
OR
|
|
This is useful for scripting capabilities:
|
|