Append to a file text, a blank line, and the last line of another file

{ echo some text; echo; tail -n1 /var/log/apache2/error.log; } >> /path/to/file

June 22, 2012bashoneliners

Explanation

All the standard output from all the commands between the braces will be redirected.

Related one-liners

Append to a file text, a blank line, and the last line of another file

echo -e "From: me\n\n$(tail -n1 /var/log/apache2/error.log)" >> file

June 21, 2012kevin