3 ms·
See also "rev": https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/text-utils/rev.c https://git.kernel.org/pub/scm/utils/util-linux/util-linux.
by bloak 6y ago
See also "rev": https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/text-utils/rev.c https://git.kernel.org/pub/scm/utils/util-linux/util-linux.g...
- tyingq 6y agoAh, yes, though that reverses each line of text individually while maintaining line order, versus reversing the whole file.
- bewuethr 6y agoThe recat tool shown seems to have the same effect as tac | rev
- tyingq 6y agoAh, I see what it does now, thanks for that. It's not exactly the same as "tac | rev" though. For a typical text file with each line ending in a newline...this recat tool outputs a newline first, and the last line is missing a newline. So it's a true reverse printing of last byte to first.
- _kst_ 6y agoYears ago, I wrote a filter that reversed lines and reversed characters within each line after padding with blanks. I ran a text file through it, printed the result, turned the paper upside down, and complained to a sysadmin that the printer was rotating each character in place. (I didn't keep them hanging for long.)