Is it possible to keep only the last 10 lines of a lines with a simple shell command?
tail -n 10 test.log
delivers the right result, but I don't know how to modify test.log itself. And
tail -n 10 test.log > test.log
doesn't work.
You can do it using tempfile.
tail -n 10 test.log > test1.log
mv test1.log test.log