Quantcast
Channel: How can I reverse the order of lines in a file? - Stack Overflow
Viewing all articles
Browse latest Browse all 26

Answer by lacostenycoder for How can I reverse the order of lines in a file?

$
0
0

For cross OS (i.e. OSX, Linux) solution that may use tac inside a shell script use homebrew as others have mentioned above, then just alias tac like so:

Install lib

For MacOS

brew install coreutils

For linux debian

sudo apt-get updatesudo apt-get install coreutils 

Then add alias

echo "alias tac='gtac'">> ~/.bash_aliases (or wherever you load aliases)source ~/.bash_aliasestac myfile.txt

Viewing all articles
Browse latest Browse all 26

Trending Articles