4 ms·
Also fallocate (Linux only though).
by Nux 4y ago
Also fallocate (Linux only though).
- natmaka 4y agodd can do it on an existing file or stream, transforming sequences of 0 it contains into "holes".
- inopinatus 4y agocaveat operator: to ensure the conv=sparse operand achieves the desired outcome, be sure to use an output blocksize equal to st_blksize of the output filesystem.
- jhugo 4y agoor just use `cp --sparse=always` if it's from one file to another
- inopinatus 4y agoThat is not so portable, so I recommend sticking with dd.
- jhugo 4y agoYup, `dd` helps in a lot of situations when you need portability, not just this one. Commands like `cp --sparse=always` aren't worth such a blanket disrecommendation though; if you are working directly at a console as opposed to scripting you typically don't need portability.
- inopinatus 4y agoAgain, most of the consoles I work at don’t use GNU coretools.
- jhugo 4y agoThen you obviously can't use this, but many people reading my suggestion can.