Table of Contents

BASH - Commands - rev

Reverses lines of a file or files.


Using with a string

echo this is to be reversed | rev

returns:

desrever eb ot si siht

Using with a file

rev .bash_profile

returns:

eliforp_hsab. #
 
snoitcnuf dna sesaila eht teG #
neht ;] crhsab./~ f- [ fi
crhsab./~ .	
if
 
smargorp putrats dna tnemnorivne cificeps resU #
 
nib/EMOH$:HTAP$=HTAP
 
HTAP tropxe