Various ways to working with file - http://www.catonmat.net/blog/bash-one-liners-explained-part-one/ Use truncate to pad the file size up - http://www.lainoox.com/truncate-shrink-extend-files/ Making a file unalterable with chattr - https://enkipro.com/insight/558ac712249a234c00842b68