macos – How to increase the byte size of a file without affecting content?

The truncate command has a little-known option to increase the size of files by adding null bytes, which won’t be visible in the content unless you’re using an editor that explicitly shows these, like vim.

The proper syntax is explained in the man page, but generally, pass the -s option and give either a size you want the file to be like -s 10k, or add a + to add that many kilobytes to the file.

The null bytes will be added at the end.