Keep number of lines from the end of a file (strip down file contents)

Strip down file contents keeping a number of lines from the end of the file. This is useful when you need to strip down large log files.

echo "$(tail -n 10 test.log)" > test.log