Keep N lines of file
# Usage
echo "$(tail -[N] [file])" > [file]
# Example
# NOTE: This may use too much memory.
echo "$(tail -500000 shared/log/production.log)" > shared/log/production.log
# Please note that `echo` must be used since tail starts redirecting before
# it finishes outputing the lines of the file.