Using the dd command:


dd if=/dev/zero of=dummyzeros bs=1000000000 count=1
1+0 records in
1+0 records out
1000000000 bytes (1.0 GB) copied, 23.6414 s, 42.3 MB/s
 
du -h dummyzeros
954M    dummyzeros
 
 
 
dd if=/dev/zero of=dummyzeros bs=1024000 count=10
10+0 records in
10+0 records out
10240000 bytes (10 MB) copied, 0.0782019 s, 131 MB/s
 
du -h dummyzeros
9.8M    dummyzeros
 
 
 
dd if=/dev/urandom of=dummyrandom bs=1024000 count=100
100+0 records in
100+0 records out
102400000 bytes (102 MB) copied, 16.3029 s, 6.3 MB/s
 
du -h dummyrandom
98M     dummyrandom