博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
macos 虚拟镜像文件_如何在macOS中使用虚拟文件测试网络或硬盘速度
阅读量:2507 次
发布时间:2019-05-11

本文共 6184 字,大约阅读时间需要 20 分钟。

macos 虚拟镜像文件

macos 虚拟镜像文件

File transfer speeds can vary greatly from device to device. The same holds true for network file transfers and uploads. One of the best ways to test these speeds on your Mac is to create dummy files with the Terminal.

设备之间的文件传输速度可能会有很大差异。 网络文件传输和上传也是如此。 在Mac上测试这些速度的最佳方法之一是使用终端创建虚拟文件。

Let’s say you’ve installed a fast new solid state drive in your computer, and want to see how fast they really are. Or maybe you’ve finally upgraded your entire setup to or , and you want to know if it performs as well as it promises. Or maybe something is just transferring slower than you think it should, and you want to test its real-world speeds (rather than the theoretical speeds on the box).

假设您已经在计算机中安装了快速的新型固态驱动器,并希望了解它们的实际速度。 或者,也许您最终将整个设置升级到了或 ,并且您想知道它的性能是否达到了预期。 或者也许某些东西的传输速度比您想象的要慢,并且您想测试其实际速度(而不是盒子上的理论速度)。

A dummy file is simply a fake, empty file of any size. Dummy files have a distinct advantage over real files when testing hard drive or network speeds, because you can instantly create a file of any size. That way, you don’t have to search your computer for equivalently sized files, and after you’re done testing, you can just delete them.

虚拟文件只是任何大小的伪造,空文件。 在测试硬盘驱动器或网络速度时,虚拟文件​​比真实文件有明显的优势,因为您可以立即创建任何大小的文件。 这样,您不必在计算机上搜索大小相等的文件,并且在完成测试后,只需删除它们即可。

如何在macOS上创建虚拟文件 (How to Create Dummy Files on macOS)

To create a dummy file, open the Terminal. If you don’t have the Terminal pinned to your Dock, you can find it in Applications > Utilities or by conducting a Spotlight search using the keyboard shortcut Command+Space.

要创建虚拟文件,请打开终端。 如果您没有将终端固定在Dock上,则可以在“应用程序”>“实用程序”中找到它,也可以使用键盘快捷键Command + Space进行Spotlight搜索。

When you open the Terminal, it starts you out in your Home directory. When you create dummy files, it’s a good idea to first change your directory to an easily accessible location, such as the Desktop, so they are automatically created there.

当您打开终端时,它将在您的主目录中启动您。 创建虚拟文件时,最好先将目录更改为易于访问的位置(例如桌面),以便在此处自动创建它们。

You can see what directories available by running the ls command, but we’re going to use the Desktop for this example. To change directories to the desktop, run:

您可以通过运行ls命令查看可用的目录,但是在本示例中,我们将使用桌面。 要将目录更改为桌面,请运行:

cd Desktop

Keep in mind that, whatever directory you choose, its name is case-sensitive—so pay attention to how the directory name is spelled if you choose to cd elsewhere.

请记住,无论选择哪个目录,其名称都区分大小写-因此,如果选择在其他位置使用cd注意目录名称的拼写。

Now that you’re in your Desktop directory, you can create dummy files right from that same terminal window. Your command will look like this:

现在您已经在Desktop目录中,您可以直接在同一终端窗口中创建虚拟文件。 您的命令将如下所示:

mkfile 
filename.ext

Just replace <size> with a number followed by a size unit. g represent gigabytes, so 4g would give you a 4GB file. You can also use m for megabytes, k for kilobytes, and b for bytes.

只需将<size>替换为数字,再加上大小单位即可。 g代表千兆字节,因此4g会为您提供4GB的文件。 您还可以使用m表示兆字节, k表示千字节, b表示字节。

Replace filename.ext with any filename you want followed by any extension, whether it’s .dmg, .txt, .pdf, or anything else.

filename.ext替换为所需的任何文件名,后跟任何扩展名,无论是.dmg,.txt,.pdf还是其他任何文件。

For example, if I wanted to make a 10,000 MB text file named dummyfile, I’d run:

例如,如果我想制作一个10,000 MB的名为dummyfile的文本文件,请运行:

mkfile 10000m dummyfile.txt

The file will appear on your desktop.

该文件将出现在您的桌​​面上。

To check the size of your dummy file, right-click it and select “Get Info”.

要检查虚拟文件的大小,请右键单击该文件,然后选择“获取信息”。

According to the Size, our new dummy file is 10,485,760,000 bytes. If and convert to megabytes (megabytes = bytes ÷ 1,048,576), it’s exactly 10,000 megabytes.

根据大小,我们的新虚拟文件为10,485,760,000字节。 如果并转换为兆字节(兆字节=字节÷1,048,576),则恰好是10,000兆字节。

如何使用虚拟文件测试传输速度 (How to Test Transfer Speeds Using Dummy Files)

Once you create a dummy file, you can use it to test transfer speeds, whether it’s using a USB flash drive, sharing a file across your home network, or something else.

创建虚拟文件后,无论使用USB闪存驱动器,通过家庭网络共享文件还是其他文件,都可以使用它来测试传输速度。

In this case, we’re going to test how long it takes to transfer our 10,000 MB file to a USB 2.0 flash drive and to a USB 3.0 flash drive to compare the speeds. (We could test with smaller files, but we really want an idea of the speed disparity, so using a larger file is going to give a more pronounced difference than a smaller file.)

在这种情况下,我们将测试将10,000 MB的文件传输到USB 2.0闪存驱动器和USB 3.0闪存驱动器需要多长时间,以比较速度。 (我们可以使用较小的文件进行测试,但我们确实希望了解速度差异,因此使用较大的文件将比较小的文件产生更明显的差异。)

The only other thing you’ll need is a stopwatch—the one on your phone should work fine.

您唯一需要的另一件事是秒表,您手机上的秒表应该可以正常工作。

With your dummy file on the desktop, click and drag it to the new drive (in our case, our flash drive) and start the stopwatch when you release the mouse button.

将您的虚拟文件放在桌面上,将其单击并拖动到新驱动器(在本例中为我们的闪存驱动器)中,然后在释放鼠标按钮时启动秒表。

Wait for the file to finish copying onto the device, then tap the “Stop” button on the stopwatch as soon as it does. There’s no need to be super precise, this is just to get a good idea of transfer times, not an exact down-to-the-millisecond number.

等待文件完成复制到设备上,然后尽快点击秒表上的“停止”按钮。 不需要非常精确,这只是为了更好地了解传输时间,而不是精确到毫秒的数字。

Then, repeat the process with the other device (in our case, the other flash drive), and compare the results.

然后,对其他设备(在我们的情况下为其他闪存驱动器)重复该过程,然后比较结果。

As you can see, our USB 3.0 file transfer (left) is significantly faster than the USB 2.0 transfer (right).

如您所见,我们的USB 3.0文件传输(左)比USB 2.0传输(右)快得多。

 

If you want to turn these values into or MB/s, just divide the file’s size by the number of seconds in your transfer time. In our case, our USB 3.0 drive can write files at around 41 megabytes per second (10000 MB ÷ 244 seconds). The USB 2.0 drive writes files around 13 megabytes per second (10000 MB ÷ 761 seconds).

如果要将这些值转换为或MB / s,只需将文件的大小除以传输时间的秒数即可。 在我们的例子中,我们的USB 3.0驱动器可以每秒41兆字节(10000 MB÷244秒)的速度写入文件。 USB 2.0驱动器每秒写入大约13兆字节(10000 MB÷761秒)的文件。

This is a simple, non-scientific example, and shouldn’t be mistaken for any kind of official benchmarking. But, it gives you a clear idea of how to test transfer speeds with dummy files.

这是一个简单的,非科学的示例,不应将其误认为任何官方基准。 但是,它为您提供了如何使用虚拟文件测试传输速度的清晰思路。

You can use them to test the difference between your , compare cloud services, or get a decent idea of and download performance.

您可以使用它们来测试之间的差异,比较云服务,或者对和下载性能有一个不错的了解。

翻译自:

macos 虚拟镜像文件

转载地址:http://bwuwd.baihongyu.com/

你可能感兴趣的文章
二级图片导航菜单
查看>>
<Using parquet with impala>
查看>>
OpenGL渲染流程
查看>>
委托异步回调
查看>>
扩展欧几里得算法
查看>>
いつでもどこでも本格的に麻雀&チュートリアルが充実!iPhone/iPod touch/iPad向け「雀龍門Mobile」をiPadで遊んでみました...
查看>>
如何重置mysql中的root密码
查看>>
bzoj 3171: [Tjoi2013]循环格 最小费用最大流
查看>>
关于IO的一些数字
查看>>
高放的c++学习笔记之模板与泛型编程
查看>>
bzoj 1089: [SCOI2003]严格n元树
查看>>
mybatis 日期比较
查看>>
更新jdk
查看>>
string与StringBuilder之性能比较
查看>>
python3----练习题(购物车)
查看>>
IOS不错的学习资源特别是图片效果的处理上
查看>>
HDU 2072(字符串的流式操作,学习了)
查看>>
win10 vs2015源码编译opencv、opencv_contrib、Tesseract
查看>>
css取消a标签在移动端点击时的背景颜色
查看>>
Annotation(注解)
查看>>