I would like to perform this command:
tail -f | tac myfile.txt
tac reverts the order of the lines, the command works fine, except for the "listen" part.
When the file is updated, the
tail command doesn't update the console.
Is it possible to perform this?
tail -f | tac myfile.txt, the
tail -fcommand is tailing standard input, while
tacis (separately) reversing the
myfile.txt- nothing actually gets piped from one to the other afaik. OTOH if you do
tail -f myfile.txt | tac, the
tacis going to hang waiting for
tail -fto finish (because it can't seek to the end of standard input).
watchmight provide a solution - please add an answer showing how you solved it
watch -n 0.5 "tail -n -50 /filepath/filename.txt | tac", it's not exactly what I was looking for, but solves the issue for my personal use.