$ wc -l myscript.log 475494 myscript.log $ echo "$(tail -1000 myscript.log)" > myscript.log $ wc -l myscript.log 1000 myscript.log