truncate -s 10G foo
fallocate -l 5G bar
It needs to be stated that truncate on a file system supporting sparse files will create a sparse file and fallocate will not
E. Veer, and E. Veer. The Missing Manual series Pogue Press, O'Reilly and Pogue Press/O'Reilly, Beijing u.a. /// Beijing /// Beijing, 1. ed. edition, (2007)
S. Bloehdorn, O. Görlitz, S. Schenk, and M. Völkel. Proceedings of the 6th International Conference on Knowledge Management (I-KNOW 06), Graz, Austria, (September 2006)
D. Ellard, J. Ledlie, P. Malkani, and M. Seltzer. Proc. of the 2nd USENIX Conference on File and Storage Technologies (FAST), page 203--216. Berkeley, CA, USA, USENIX Assoc., (2003)
N. Agrawal, W. Bolosky, J. Douceur, and J. Lorch. Proc. of the 5th USENIX conference on File and Storage Technologies (FAST), Berkeley, CA, USA, USENIX Assoc., (2007)
J. Douceur, and W. Bolosky. Proc. of the ACM International Conference on Measurement and Modeling of Computer Systems (SIGMETRICS), page 59--70. ACM Press, (1999)
D. Hickok, D. Lesniak, and M. Rowe. 38th Midwest Instruction and Computing Symposium April 8 - 9, 2005. University of Wisconsin-Eau Claire, Eau Claire, WI, (2005)
T. Reidemeister, M. Munawar, and P. Ward. Proceedings of the of the Fourth International Workshop on Engineering Autonomic Software Systems, CASCON, (2007)