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 gigabit ethernet or wireless AC, 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).

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

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 <size> 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 we check this number 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 wired Ethernet network connection and wireless Wi-Fi connection, compare cloud services, or get a decent idea of your Internet connection’s practical upload and download performance.

您可以使用它们来测试有线以太网网络连接和无线Wi-Fi连接之间的差异,比较云服务,或者对Internet连接的实际上载和下载性能有一个不错的了解。

翻译自: https://www.howtogeek.com/296882/how-to-test-your-network-or-hard-drive-speeds-with-a-dummy-file-in-macos/

macos 虚拟镜像文件

macos 虚拟镜像文件_如何在macOS中使用虚拟文件测试网络或硬盘速度相关推荐

  1. matlab分析xml文件_如何在Java中读取XML文件(DOM分析器)

    matlab分析xml文件 Today we will learn how to read the XML file in Java. We will also learn how to parse ...

  2. chrome查看网页文件_如何在Chrome中直接将文件和网页下载到Google云端硬盘

    chrome查看网页文件 We've all downloaded files from the web to our computer. However, if you'd rather downl ...

  3. python 读取日志文件_如何在Python中跟踪日志文件?

    使用SH模块(PIP安装sh):from sh import tail# runs foreverfor line in tail("-f", "/var/log/som ...

  4. python发送excel文件_如何在Python中使用Excel文件(xlsx)附件发送电子邮件

    我需要发送一封带有Excel附件的电子邮件 我的代码如下,可以发送电子邮件 但是当我收到邮件时,附件文件不是Excel文件~~ 看来我附加的格式不对~~~ 我添加了不同的电子邮件地址来接收此电子邮件 ...

  5. git 还原文件到其他版本_如何在Git中还原旧文件版本

    git 还原文件到其他版本 读: 第1部分:什么是Git? 第2部分:Git入门 第3部分:创建第一个Git存储库 第4部分:如何在Git中还原旧文件版本 第5部分:3个用于Git的图形工具 第6部分 ...

  6. python解析sql文件_如何从Python中解析sql文件?

    是否有任何方法可以从Python中执行.SQL文件中的某些SQL命令,而不是文件中的所有SQL命令?假设我有以下.sql文件:DROP TABLE IF EXISTS `tableA`; CREATE ...

  7. 如何在前端删除项目中的文件_如何在macOS上恢复已删除的文件

    有时候不小心删除了我们不打算删除的MacBook上的文件.在MacBook上恢复永久删除的文件非常困难,但这并非不可能.在本文中,我们将指导您如何恢复MacBook上最近恢复的文件或永久删除的文件.从 ...

  8. 如何在Windows中使用虚拟文件测试网络或硬盘速度

    If you want to see how fast your network really is, or test the speed between two hard drives, then ...

  9. 克隆git文件_如何在Git中克隆,修改,添加和删除文件

    克隆git文件 在本系列有关Git入门的第一篇文章中 ,我们创建了一个简单的Git存储库,并通过将其连接到计算机将文件添加到其中. 在本文中,我们将学习有关Git的其他一些知识,即如何在Git存储库中 ...

最新文章

  1. SQL Server 数据库文件 4 点注意
  2. 面向接口编程详解(三)——模式研究
  3. asp中关于从utf8页面到gb2312页面出现乱码得解决
  4. python求两个列表的并集.交集.差集方法
  5. 软件设计模式—控制反转
  6. java arraylist 常用方法_分享ArrayList中的几个常用方法的源码
  7. java连接phpstudy_PHPStudy快速自动搞定所有配置文件
  8. 批量统计多个PPTX文件中幻灯片总数量
  9. VMware vSphere Client下增加虚拟机磁盘空间的方法
  10. ftdi+usb转串口驱动+android,FTDI usb转串口驱动
  11. html+css常用代码(前端必备)
  12. centos 定时任务
  13. CURL -w 参数详解
  14. 计算机打字正确姿势,电脑打字手指的正确姿势,涨知识了
  15. 你还在用命令看日志?快用 Kibana 吧,一张图片胜过千万行日志!
  16. 动态规划——钢条切割
  17. ASP.NET 2.0 本地化技术之研究
  18. 冷小黑OD过检测v1.0绿色版
  19. docker 常用命令全解
  20. 2020年下系统集成项目管理工程师真题基础知识+解析2/3

热门文章

  1. surface go升级win11
  2. 怎么把图片存在mysql_如何把图片存储在mysql中
  3. 用python写一个有AI的斗地主游戏(二)——简述后端代码和思路
  4. 《再别康桥》(徐志摩)
  5. RSA分段加密/解密 nodejs 和java联调
  6. 视频教程-软考系统集成项目管理工程师视频教程(法律法规)-软考
  7. 590. N-ary Tree Postorder Traversal*
  8. SPA(单页面应用)
  9. Myeclipse10完美破解过程
  10. ubuntu18.04 opencv 获取摄像头 (C++/python) 双目摄像头