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
, thetail -f
command is tailing standard input, whiletac
is (separately) reversing themyfile.txt
- nothing actually gets piped from one to the other afaik. OTOH if you dotail -f myfile.txt | tac
, thetac
is going to hang waiting fortail -f
to finish (because it can't seek to the end of standard input).watch
's command.watch
might provide a solution - please add an answer showing how you solved itwatch -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.