I have the following.
- A Java process writing logs on file
- A shell script starting
the Java process.
I need to read the log file after start Java process to check correct starting.
I have try with tail -f
but it remain append forever. I need tail
stop after print n lines. There is a way like -n
option for previuos lines?
Best Answer
You can pipe the output of
tail -f
tohead
to limit the amount of lines shown:to only show 100 lines in total.