This page was exported from phaq
[ http://phaq.phunsites.net ] Export date: Sat Jun 10 0:28:58 2023 / +0000 GMT |
The 'cat' utility serves it's purpose print the content of a file at once. So do 'more' and other tools as well. But they all do in 'forward' mode only. To print a file in reverse order, at least some linux distros come with the 'tac' command, which will do a 'reverse cat'. But what to do, if 'tac' is missing? If you don't want to go for an additional tool to compile and install, why not check out Perls abilities? Here's how to do it with a PIPE:
You can also run it directly on a filename like this:
You can do it with 'sed' as well:
Personally I favor the Perl method as it's easier to memorize, despite having more to type ;-) Enjoy! |
Powered by [ Universal Post Manager ] plugin. HTML saving format developed by gVectors Team www.gVectors.com |