succinctly

Dimitris Raviolos

remove whitespace from the end of a file

IDEs sometimes are configured to add a final newline.

However, recently I encountered an issue where I wanted a hugo shortcode template to not have that final newline my editor added, because it would look ugly on the generated html.

Thus, coreutils to the resque! Instead of messing with my editor settings, I can do this:

❯ cat f
hello world!

~
❯ truncate -s -1 f

~
❯ cat f
hello world!
~
❯