Is there a command to output a large file and follow on directly in the shell stdout?
I am aware of less +F
or I could simply use tail
with an ultimately high n
like tail -f -n1000000
if the file is already big, when I call tail
but I was wondering if there is a proper way to handle this.
less
is not handy in my situation because the files I handle contain carriage returns and the like, which less
displays instead of moving the cursor. cat
heads the CR
but does not follow and tail -f
does not give me the whole picture... basically I guess I am looking for cat -f <single-file>
tail -f
doesn't truncate output, it will just keep displaying whatever has come so far while still displaying what was there earlier in the terminal. How would yourcat -f
handle multiple files? – cryptarch Feb 14 '21 at 21:26tail -n +1 -f file
). That will print the full file and will keep following it, regardless of how big it is. I guess I'm not getting how this is different from what your question is asking for. – fra-san Feb 14 '21 at 22:05-nx
and-n +x
. Terribly sorry. Would love to accept your answer as solution if you follow up on your comment. Or mark as duplicate if I found a matching question. Open to suggestions :-) – Björn Feb 14 '21 at 22:14less -r +F
? – Kamil Maciorowski Feb 14 '21 at 22:25-n +1 -f
. – Eduardo Trápani Feb 14 '21 at 22:48tail
to pointlessly "parse" your file, unlikecat
), tail it by bytes:tail -fc+1 file
. – Feb 15 '21 at 00:43tail -fc+1
andtail -fn+1
will be much different, the first one tellstail
to skip 0 byte before starting thetail -f
loop and the second one to skip 0 line before starting thetail -f
loop. In both cases, that just tellstail
to enter thetail -f
loop straight away. – Stéphane Chazelas Feb 15 '21 at 18:16