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
S. Ferré, and O. Ridoux. Proceedings of the 9th International Conference on Conceptual Structures, volume 2120 of Lecture Notes in Artificial Intelligence, page 187-201. Springer, (2001)
D. Gifford, P. Jouvelot, M. Sheldon, and J. O'Toole. Proceedings of the 13th ACM Symposium on Operating Systems Principles, 25, page 16-25. Pacific Grove, California, United States, ACM Press, (1991)