fallocate
linux
Reserve or deallocate disk space to files. The utility allocates space without zeroing.
More info →Options (3)
-l, --lengthbooleanReserve a file taking up 700 MiB of disk space
Example:
fallocate {{[-l|--length]}} 700M {{path/to/file}}-c, --collapse-rangebooleanShrink an already allocated file by 200 MB
Example:
fallocate {{[-c|--collapse-range]}} {{[-l|--length]}} 200MB {{path/to/file}}-o, --offsetbooleanShrink 20 MB of space after 100 MiB in a file
Example:
fallocate {{[-c|--collapse-range]}} {{[-o|--offset]}} 100M {{[-l|--length]}} 20M {{path/to/file}}Examples (3)
Reserve a file taking up 700 MiB of disk space
fallocate [-l|--length] 700M path/to/fileShrink an already allocated file by 200 MB
fallocate [-c|--collapse-range] [-l|--length] 200MB path/to/fileShrink 20 MB of space after 100 MiB in a file
fallocate [-c|--collapse-range] [-o|--offset] 100M [-l|--length] 20M path/to/filemade by @shridhargupta | data from tldr-pages