Server 上如何產生一個大的測試檔?

突然需要在 Solaris 跟 Linux OS 間測試 FTP 的速度,
所以需要產生一個大的檔案來測試 FTP,於是就把這個 command 翻出來用囉...

Case1. 如何在 Linux OS 上產生一個空的大檔案:

To create a file of a specified size, like the Solaris mkfile command...
# dd if=/dev/zero of=/tmp/bigfile bs=1M count=2048

以上這個動作將會產生一個 (2048 * 1MB) blocks or (2GB) 的檔案 /tmp/bigfile .

Case2. 如何在 Solaris OS 上產生一個空的大檔案:

# mkfile 10m filename
則檔案大小為 10m = 10 MG byte 大小
# mkfile 10g filename
則檔案大小為 10g = 10 GB byte 大小
0 Responses