For the complete documentation index, see llms.txt. This page is also available as Markdown.

Read Command Output In Reverse Order

We can use tac to read file(s) or stdout in reverse order.

tac - concatenate and print files in reverse

Example

echo -e "Hello\nWorld" | tac
World
Hello

Source: StackOverFlow

Last updated