Skip to content

Instantly share code, notes, and snippets.

@harshithjv
Last active September 15, 2022 13:16
Show Gist options
  • Select an option

  • Save harshithjv/521ecd2d858e4eaaaaa6f546df9e8824 to your computer and use it in GitHub Desktop.

Select an option

Save harshithjv/521ecd2d858e4eaaaaa6f546df9e8824 to your computer and use it in GitHub Desktop.
How to create dummy files in Windows and *nix platforms

Windows cmd line to create dummy 1 GB file:

C:\ fsutil file createnew dummy.doc 1073741823
File C:\dummy.doc is created

Linux shell to create dummy 1 GB file:

fallocate -l 1G dummy.doc

Other linux commands: (Source: https://stackoverflow.com/questions/257844/quickly-create-a-large-file-on-a-linux-system )

xfs_mkfile 1024m 1Gigfile

mkfile 1024m 1Gigfile

truncate -s 1G 1Gigfile

dd if=/dev/zero of=./gentoo_root.img bs=4k iflag=fullblock,count_bytes count=1G
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment