Equivalent Solairs mkfile command in Linux

If you have Solaris administrator experience , you may know we can use mkfile to create a big empty file for some purpose.In linux there are some equivalent commands.

1 .truncate

For example ,we can use below command to make a 10G empty file

truncate -s 10G 10gfile

2. dd

Below command does the same thing as above truncate command

dd if=/dev/zero of=10gfile bs=1G seek=10 count=0

3. fallocate

Note: this command only been supported by some file systems like ext4 , xfs

fallocate -l 10G 10gfile