Performing disk write test on Linux command line

dd if=/dev/zero of=/write.test bs=1M count=1024

Performs 1GB write test:

root@ubuntu:/home/ubuntu# dd if=/dev/zero of=/write.test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.8919 s, 1.2 GB/s

dd if=/dev/zero of=/tmp/write2.img bs=512 count=1000 oflag=dsync

Performs 512 kB write test:

root@ubuntu:/home/ubuntu# dd if=/dev/zero of=/tmp/write2.img bs=512 count=1000 oflag=dsync
1000+0 records in
1000+0 records out
512000 bytes (512 kB, 500 KiB) copied, 2.21003 s, 232 kB/s