Как проверить скорость Интернета в командной строке
Для проверки скорости Интернета есть различные онлайн-сервисы и программы — все они в достаточной мере удобны и в разной степени точны. Но, если по какой-то причине обычных методов вам недостаточно, можно использовать и командную строку Windows.
В этой простой инструкции о том, как проверить скорости Интернета в командной строке Windows 11/10.
Использование Speedtest CLI
Многим известен и часто используется тест скорости Интернета SpeedTest by Ookla. Этот же разработчик предлагает программу для интерфейса командной строки, позволяющую оценивать скорости Интернета. Скачать необходимые файлы можно с официального сайта.
Скачав архив, распакуйте его в удобное расположение на диске (чтобы в командной строке не требовалось вводить полный путь к исполняемому файлу, можно использовать папку, добавленную в переменную среды PATH).
Этого достаточно, чтобы приступить к использованию. Для простой проверки скорости Интернета запустите командную строку и введите:
speedtest.exe
В примере я указываю speedtest.exe, но в зависимости от расположения файла может потребоваться ввести полный путь к нему. При первом использовании потребуется принять условия лицензионного соглашения (ввести Y или YES и нажать Enter). Ближайшие серверы будут подобраны автоматически. Учитывайте, что результат представлен в мегабитах в секунду, если требуются мегабайты — разделите значение на 8.
При необходимости вы можете использовать speedtest с дополнительными параметрами, список которых можно найти в файле speedtest.md в скачанном архиве.
Несколько примеров:
- Используя параметр
-uMB/s
или
--unitMB/s
можно включить измерение в мегабайтах в секунду.
- С помощью параметра
-L
или
--servers
можно получить список ближайших серверов, а затем указать нужный сервер по его id с помощью параметров
-s
или
--server-id
- Для регулярной автоматической проверки скорости и сохранении результатов в файл CSV (с добавлением новых результатов к старым), можно использовать команду PowerShell, запускаемую в планировщике заданий или иным способом:
speedtest --accept-license --format=csv --progress=no --output-header| convertfrom-csv | Export-Csv "C:\speedtest.csv" -append -notypeinformation -force
При необходимости можно использовать speedtest.exe в собственных сценариях bat, PowerShell, Python и других. Хороший пример использования в сценарии PowerShell для автоматизации тестирования скорости Интернета.
Несмотря на то, что большинство проектов, имеющих отношение к проверке скорости Интернет-соединения, используют Speedtest от Ookla (например, Speedtest-cli на Python), есть и другие решения. Один из примеров — мультиплатформенный LibreSpeed CLI.
Как протестировать скорость Интернета из командной строки
Тестируем скорость Интернета через командную строку!

Можно открыть страницу Speedtest или любого другого аналогичного сервиса в браузере, но иногда бывает такое настроение, что руки прямо-таки тянутся к командной строке. Именно в эти моменты можно тестировать шустрость своих Интернетов чуть более интересным способом.
Подобные забавы доступны и пользователям Windows после установки Cygwin, curl или wget. Для Mac можно использовать curl, ну а поклонникам wget придётся предварительно установить его.
Тест с помощью curl
Тут всё элементарно. Просто копируем и вставляем указанную ниже команду (не переживайте, что она отображается тут в 2 строчки, всё вставится нормально).
curl -o /dev/null http://speedtest.sea01.softlayer.com/downloads/test100.zip
В данном случае для теста используется архив zip размером 100 мегабайт с сайта Softlayer. При очень шустром соединении такого размера может не хватить, и тут пригодятся более ёмкие архивы с Thinkbroadband. Например, вот этот архив в 1 гигабайт.
curl -o /dev/null http://download.thinkbroadband.com/1GB.zip
Обратите внимание, что ‑o представляет собой прописную букву «o», а не нуль. Поскольку загрузка происходит в /dev/null, после завершения процесса файл автоматически удалится.
Тест с помощью wget
Разница в данном случае заключается только в используемой программе. В остальном синтаксис команды почти идентичен первому примеру, только в месте ‑O буква заглавная.
wget -O /dev/null http://speedtest.sea01.softlayer.com/downloads/test100.zip
Счастливых вам минут в окружении родного терминала.
Для онлайн тестирования скорости интернета существуют большое количество онлайн-сервисов. Если вам нужно периодически собирать метрики скорости Интернет-подключения от провайдера для системы мониторинга, можно воспользоваться широко известной консольный клиент Speedtest от Ookla. В этой статье, мы рассмотрим, как измерить скорость Интернет-подключения из командной строки Windows (скрипта PowerShell).
Скачайте консольную утилиту speedtest.exe для Windows с сайта https://www.speedtest.net/apps/cli и распакуйте в локальный каталог.
Чтобы автоматически протестировать скорость скачивания/загрузки сети до ближайшей к вам локации с сервисом Speedtest, выполните команду:
.\speedtest.exe
Утилита вернет скорость скачивания, загрузки (в Мбит/с), сетевые задержки с вашего компьютера до ближайшего сервера Speedtest. Если сервер расположен близко к вам (а их действительно очень много), условно это и будет вашей скоростью Интернета.
Можно вручную выбрать провайдера, страну и город с сервером Speedtest, до которого нужно тестировать подключение. Выведите список ближайших точек и скопируйте ID:
.\speedtest.exe -L
Выполнить тестирование до выбранного сервера:
.\speedtest.exe -s 37149
Утилита speedtest позволяет возвращать результаты в структурированных форматах (CSV, JSON, TSV), что удобно, когда вам нужно дополнительно извлечь данные из результатов или отправить результату проверки в систему мониторинга.
Например, чтобы получить результаты тестирования скорости Интернета из скрипта PowerShell:
$speedtestcmd = & "C:\ps\Speedtest\speedtest.exe" --accept-license -s 37149 -f json
$speedtestresult=ConvertFrom-Json $speedtestcmd
$result=[PSCustomObject]@{
Download = [math]::round($speedtestresult.download.bandwidth/1MB, 5)*8
Upload = [math]::round($speedtestresult.upload.bandwidth/1MB, 5)*8
}
$result
Вы можете передать результаты тестировании скорости интернета в виде метрик в вашу систему мониторинга (как получить данные в Zabbix из PowerShell скрипта).
В локальной сети можно протестировать пропускную способность сети между двумя машинами можно с помощью утилиты iperf.
You can check your internet speed directly from the Command Prompt using a simple command with a tool called `speedtest-cli`.
Here’s how to do it:
speedtest
Make sure you have `speedtest-cli` installed; you can do this via Python’s pip by running:
pip install speedtest-cli
Understanding Internet Speed Measurements
What is Internet Speed?
Internet speed refers to the rate at which data is transmitted over the internet. It is commonly measured in megabits per second (Mbps) and varies by service provider and the type of connection. Key terms include:
- Bandwidth: The maximum amount of data that can be transferred in a given amount of time.
- Download Speed: The rate at which data is received from the internet.
- Upload Speed: The rate at which data is sent from your device to the internet.
- Latency: The delay before a transfer of data begins following an instruction.
Why Check Your Internet Speed?
Checking your internet speed is crucial for several reasons:
- Troubleshooting: Understanding your internet speed can help diagnose connectivity issues, ensuring devices can access the internet as intended.
- Service Validation: Regular checks help reassure that you are receiving the speed you pay for from your internet service provider (ISP).
- Performance Optimization: Monitoring speed can assist in identifying times when your connection may be slower, informing decisions on network management and resource allocation.
Check Time Server Cmd: A Quick Guide to Synchronization
Getting Started with CMD
How to Access CMD
To begin using CMD commands for checking your internet speed, you first need to open the Command Prompt:
- Press Windows + R to open the Run dialog.
- Type cmd and hit Enter.
- The Command Prompt window will appear, ready for input.
Familiarity with the CMD interface is valuable as it enables you to run various networking commands efficiently.
Check Port Cmd: A Quick Guide to Port Checking
Checking Internet Speed with CMD
Using the Built-in Command Tools
Ping Command
What is Ping?
Ping is a utility that tests the connection speed between your device and another IP address or hostname. It helps to measure the round-trip time for messages sent from your device to the target.
Using Ping to Test Speed
To use the ping command effectively, execute the following:
ping google.com -n 10
This command sends 10 packets to Google’s server, and the output will show the time each packet took to return.
- Interpreting Results: Look for the «Minimum», «Maximum», and «Average» times on the results page. Shorter times (measured in milliseconds) indicate a faster connection.
Tracert Command
What is Traceroute?
Traceroute (or tracert in CMD) displays the path your data takes to reach its destination, providing insight into potential delays along the route.
Using Tracert to Analyze Path
Execute the following command:
tracert google.com
- Reading Results: Each line indicates a hop your data packet takes along the way to reach its destination. Notice the time taken at each hop. Long response times may indicate slow points in your network path.
Checking Internet Speed with Third-Party CMD Tools
Using PowerShell and Speedtest CLI
What is Speedtest CLI?
Speedtest CLI, developed by Ookla, is a command-line interface to test your internet speed easily and quickly.
Installation of Speedtest CLI
- Download the executable from the official Speedtest website.
- Move the executable to a folder accessible from CMD or include the directory in your PATH variable.
Running Speedtests from CMD
Once installed, you can run the simple command:
speedtest
- Interpreting Results: The output will show your download and upload speeds along with ping times. This gives a comprehensive view of your internet connection.
Using CURL for Download Speeds
What is CURL?
CURL is a command-line tool used for transferring data. It’s especially useful for testing download speeds from a specific URL.
Using CURL to Test Download Speed
You can carry out a download speed test using the following command:
curl -o /dev/null http://speed.hetzner.de/100MB.bin
- Understanding the Output: The command downloads a file while disregarding its contents and will provide you with the download speed in real-time, along with the total time taken for the operation.
Check Packet Loss Cmd: A Simple Guide to Troubleshooting
CMD Bandwidth Test Tools
Other Useful CMD Commands for Network Testing
Netsh Commands
What is Netsh?
Netsh is a versatile command-line scripting utility that allows you to configure and display the current status of your network settings.
Example Commands:
To check the status of your wireless network, use:
netsh wlan show interfaces
This command provides vital statistics about your active wireless connections, including the current speed, signal quality, and other useful information.
Additional Tips for Improving Internet Speed Tests
Resetting Your Network
Sometimes network settings can become problematic. Resetting can solve many issues. To reset network settings through CMD:
netsh int ip reset
netsh winsock reset
These commands will reset your TCP/IP stack and the Winsock catalog, potentially resolving connectivity issues.
Checking for Background Applications
Certain background applications can monopolize bandwidth, affecting your speed test results. To identify such applications, you might:
- Use the Task Manager to check active processes.
- Run:
netstat -a
This command will list all active connections and listening ports, assisting you in spotting any suspicious or high-bandwidth-consuming applications.
Checksum Cmd: A Quick and Simple Guide
Conclusion
In summary, utilizing CMD to check internet speed offers a straightforward approach to understanding your network performance. By familiarizing yourself with commands like Ping, Tracert, and Speedtest CLI, you can efficiently diagnose issues and ensure that your internet connection meets your expectations. Regular checks can empower you to maintain an optimal online experience, taking control of your internet performance and troubleshooting connectivity woes effectively.
Здравия!
Вообще, для проверки скорости Интернета можно воспользоваться онлайн-тестами из-под браузера (у меня даже заметка была).
Однако, они не всегда удобны, особенно когда требуется периодически проверять скорость, например, для систем мониторинга (или для некоторых сервисов/игр). И в этом плане неплохо выделяется консольная утилита SpeedTest от Ookla. Именно в ней покажу, как можно быстро проверить скорость в командной строке (терминале) до ближайшего сервера в вашем регионе…
*
Примечание: тест в SpeedTest по умолчанию отображается в Mbps (Мбит/с). Т.е. это не та скорость, которая показывается у вас в uTorrent (например). Чтобы перевести Мбит/с в Мбайт/с — просто разделите значение из SpeedTest на 8. Например, тест показал скорость загрузки 24 Мбит/с — значит загружать в uTorrent вы будете в лучшем случае со скоростью ∼3 Мбайт/с. ✏️Подробнее об этом —>
*
Пример теста скорости сети
📌 ШАГ 1
Для начала нужно загрузить консольную утилиту speedtest.exe к себе на диск. Сделать это можно с офиц. сайта: https://www.speedtest.net/apps/cli (см. ссылочку для Windows).
Download for Windows — загружаем speedtest.exe для Windows
Кстати, на офиц. сайте есть также инструкции по установке утилиты на др. ОС (Linux, MacOS и пр.).
*
📌 ШАГ 2
Загруженный архив нужно открыть и разархивировать (в нем 2 файла: speedtest.exe и speedtest.md). Их оба необходимо скопировать в папку Windows, что находится на системном диске «C:\».
Переносим загруженные файлы в папку Windows
*
📌 ШАГ 3
Теперь можно запустить командную строку (или терминал) под администратором и ввести команду speedtest.exe (нажать Enter).
Speedtest автоматически подберет ближайший к вам сервер и измерит скорость загрузки/отдачи (Downloads\Uploads). В моем примере ниже: 51 и 94 Мбит/с соответственно…
Пример теста
*
📌 ШАГ 4
Кстати, можно вручную выбрать нужный сервер для теста. Для этого есть спец. команда, которая выведет ближайшие точки, доступные для теста:
speedtest.exe -L
Обратите внимание на ID напротив каждой локации. Запомните тот ID, который вам нужен!
Примечание: все ключи и опции к утилите указаны в шаге-5 ниже.
Смотрим список близлежащих серверов
Далее останется ввести нужный ID точки в команду следующего вида:
speedtest.exe -s 55073
(вместо 55073 — укажите свой ID).
Указываем тест до сервера по ID
*
📌 ШАГ 5
Так же для справки приведу все ключи и команды для работы с консольной утилитой speedtest (см. ниже Options, в оригинале).
✏️ Options
-
-h, —help
Print usage information -
-v
Logging verbosity, specify multiple times for higher verbosity (e.g. -vvv) -
-V, —version
Print version number -
-L, —servers
List nearest servers -
–selection-details
Show server selection details -
-s id, –server-id=id
Specify a server from the server list using its id -
-o hostname, –host=hostname
Specify a server from the server list using its hostname -
-f format_type –format=format_type
Output format (default = human-readable)
Note: Machine readable formats (csv, tsv, json, jsonl, json-pretty) use bytes
as the unit of measure with max precision.format_type values are as follows:
- human-readable human readable output
- csv comma separated values
- tsv tab separated values
- json javascript object notation (compact)
- jsonl javascript object notation (lines)
- json-pretty javascript object notation (pretty)
-
–output-header
Show output header for CSV and TSV formats -
-u* unit_of_measure***, —unit*** unit_of_measure*
Output unit for displaying speeds (Note: this is only applicable
for ‘human-readable’ output format and the default unit is Mbps)- bps bits per second (decimal prefix)
- kbps kilobits per second (decimal prefix)
- Mbps megabits per second (decimal prefix)
- Gbps gigabits per second (decimal prefix)
- kibps kilobits per second (binary prefix)
- Mibps megabits per second (binary prefix)
- Gibps gigabits per second (binary prefix)
- B/s bytes per second
- kB/s kilobytes per second
- MB/s megabytes per second
- GiB/s gigabytes per second
- auto-binary-bytes automatic in binary bytes
- auto-decimal-bytes automatic in decimal bytes
- auto-binary-bytes automatic in binary bits
- auto-binary-bytes automatic in decimal bits
-
-a
Shortcut for [-u auto-decimal-bits] -
-A
Shortcut for [-u auto-decimal-bytes] -
-b
Shortcut for [-u auto-binary-bits] -
-B
Shortcut for [-u auto-binary-bytes] -
-P decimal_places –precision=decimal_places
Number of decimal_places to use (default = 2, valid = 0-8) -
-p yes|no –progress=yes|no
Enable or disable progress bar (default = yes when interactive) -
-I interface –interface=interface
Attempt to bind to the specified interface when connecting to servers -
-i ip_address –ip=ip_address
Attempt to bind to the specified IP address when connecting to servers -
–ca-certificate=path
Path to CA Certificate bundle.
*
Иные рекомендации и заметки можно оставить через форму комментирования ниже.
Всего доброго!
👋