Ping ya ru n 497349794379479

The command line is a software tool for entering commands by the user and getting the results of their execution on the screen. In modern operating systems of the Windows family, the command line is provided by the standard cmd.exe application, also called the command processor, command interpreter, and console. The Command Line application provides the user with a text-based interface for entering commands and getting the results of their execution. In fact, the command line is a software emulator of the classic console of the first computer systems, which is a terminal with a keyboard used by the operator as a means of communicating with the computer. As in the days of the first computers, the command line supports the standard input device, the keyboard, and the standard output device, the display. The user enters commands from the keyboard and receives the results of their execution on the display screen.

The ping command pings a specific network host on a local network or the Internet.

The command syntax is:

An example of the execution of the ping command is as follows:

PING ya.ru (87.250.250.242): 56 data bytes
64 bytes from 87.250.250.242: icmp_seq=0 ttl=250 time=32.702 ms
64 bytes from 87.250.250.242: icmp_seq=1 ttl=250 time=14.315 ms
64 bytes from 87.250.250.242: icmp_seq=2 ttl=250 time=22.952 ms
64 bytes from 87.250.250.242: icmp_seq=3 ttl=250 time=22.265 ms
64 bytes from 87.250.250.242: icmp_seq=4 ttl=250 time=42.417 ms
64 bytes from 87.250.250.242: icmp_seq=5 ttl=250 time=15.399 ms
^C
— ya.ru ping statistics —
6 packets transmitted, 6 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 14.315/25.008/42.417/9.838 ms

The command sends a request to the server and receives a response from the server.

By default, ping continues to send a request to the server every second until the process is interrupted by the Ctrl + C key combination.

Using the -c option, you can limit the number of requests sent to the tested network node:

ping -c 2 ya.ru

Not all servers support the ping command, in which case a request time out response will be received:

PING ya.ru (87.250.250.242): 56 data bytes
Request time out for comp_seq 0
Request time out for icomp_seq 1
Request time out for comp_seq 2
Request time out for comp_seq 3
Request time out for comp_seq 4
Request time out for comp_seq 5
— ya.ru ping statistics —
6 packets transmitted, 0 packets received, 100.0% packet loss

Sometimes the ping command on the server is blocked on purpose to reduce the load on the resource or hide the server.

The ping command uses ICMP (Internet Control Message Protocol), which is a network layer protocol like TCP or UDP.

The command is useful for finding out the availability of a network node and its distance, in terms of the time required for data exchange. Usually, based on simple physical laws, the closer the server is, the faster the response will be returned.

The ping command works on Linux, MacOS, WSL – any UNIX based environment.

Thank you for your attention.

A situation familiar to many: the computer is turned on, there is Internet access, but a specific site or server on the network does not open. For example: the game server is not available or the game slows down a lot when connected to it. What to do? The answer is simple – check for ping and trace! In other words, you can check the availability of network resources using diagnostic methods, the most common of which are the Ping, Tracert / Traceroute and MTR / WinMTR utilities. Let’s take a closer look at each of these utilities.

The Ping network utility is the easiest way to check the availability of any network resource. Provided that this resource has “pings” from outside, that is, the use of the ICMP protocol is allowed.

How does it work? The Ping command sends small data packets to the server to be checked. In Windows, by default, a series of 4 such packets is sent. On Linux, packets are sent continuously until the user aborts the operation. After some time, a response comes from the server – in the form of the same packets that were sent. If the number of sent and received packets is the same, this means the server is “live” and there are no problems with its availability.

How to ping a website or server in Windows?

Ping is a console utility that is run from the command line. It is present in all versions of Windows OS. I will show her work on the example of Windows 11.

Right-click on the “Start” button to open an additional menu. There you need to select the “Terminal” option (in Windows 10 it is “Command Prompt”):

Ping ya ru n 497349794379479

Ping ya ru n 497349794379479

Look at the result: 4 packets of 32 bytes were sent. The transit time for each packet averaged 22 ms. All sent packets reached the server and returned back.

Ping ya ru n 497349794379479

By default, the Windows Ping command sends a total of 4 data packets.

To send more packets, you can set the number of packets with the -n option. Example for sending 10 test packets:

ping –n 10 yandex.ru

The result will be:

Ping ya ru n 497349794379479

Alternatively, you can use the ping command with the “-t” option to ping the server indefinitely, until the task is forcibly terminated, as in Linux. The command will look like this:

ping ya.ru -t

An example of ping command execution:

Ping ya ru n 497349794379479

This is how the result of executing the Ping command on an inaccessible network resource or host, to which ICMP packets are closed, looks like.

Ping ya ru n 497349794379479

How to check ping to server in Linux?

Ping ya ru n 497349794379479

Unlike systems of the Windows family, by default, Linux ping checks continuously until the user interrupts this process using the Ctrl + C key combinations.

In Linux, you can also set the desired parameters using arguments, but they may differ from the arguments in Windows, which I showed above. For example, in Linux, the number of test packages is specified through the “-c” argument, and not through “-n”. In order to see all available arguments of the Ping command, enter the following command:

Ping ya ru n 497349794379479

As you can see, there are a lot of arguments, which allows you to conduct a very thorough network diagnosis of the availability of a remote network node

PING command – send an ICMP echo request to the name or IP address of the target host

Command line format:

-t – Send packets continuously.
Keyboard shortcuts are used to complete and display statistics
Ctrl + Break (display statistics and continue), and Ctrl + C (display statistics and end).

-a – Determine addresses from hostnames.

-n number – Number of echo requests to send.

-l size – The size of the data field in bytes of the request being sent.

-f – Set the flag to disable fragmentation of the package.
-i TTL – Setting the lifetime of the package (“Time To Live” field).

-v TOS – Set the type of service (“Type Of Service” field).
-r number Record the route for the specified number of hops.
-s number – Timestamp for the specified number of jumps.
-j list of nodes – Free choice of route according to the list of nodes.
-k list of nodes – Hard choice of route according to the list of nodes.
-w timeout – Maximum time to wait for each response in milliseconds.

:/>  Virtual CD - скачать бесплатно Virtual CD

ping google.com – echo request to host named google.com with default parameters – number of packets is 4, data array length = 32 bytes.

ping -6 ya.ru – ping host ya.ru using Ipv6 protocol

ping -a 192.168.1.50 – perform a ping to determine the name of the cone node by its address.

ping -s 192.168.0.1 computer – ping host computer from source 192.168.0.1. Used when the computer has multiple network interfaces.

ping w 5000 ya.ru – ping with a waiting timeout of 5 seconds (default is 4 seconds).

ping -n 5000 -l 1000 ab57.ru – poll the host ab57.ru 5000 times, with data packets of 1000 bytes. The allowed maximum data length is 65500.

ping -n 1 -l 3000 -f ya.ru – ping with no packet fragmentation.

ping -n 1-r 3 ya.ru – send 1 echo request to the ya.ru node displaying the first 3 hops along the route.

ping -i 5 ya.ru – ping with time to live TTL=5. If more hops are required to reach the destination node, then the router that aborted the delivery will respond with the message “TTL exceeded while transmitting the packet.”

A generalized scheme for connecting a computer (tablet, laptop on a home network) to a remote end node can be represented as follows:

Ping ya ru n 497349794379479

The PING command can be used to diagnose individual nodes:

ping 127.0.0.1 is a loopback interface ping. Should run without errors if the network software components are installed and in a healthy state.

ping your own IP or name – ping your own address or name. Should complete without error if all IP software is installed and the network adapter is healthy.

ping yandex.ru – poll the host named yandex.ru. If the poll ends with an error, then the reason may be not only the lack of communication with the provider’s router, but also the inability to determine the address of the yandex.ru host due to problems with name resolution software.

ping -t yandex.ru – perform ping before pressing the CTRL + C combination, When you press CTRL + Break – statistics are displayed and
node polling continues.

ping -n 1000 -l 500 192.168.1.1 – ping 1000 times using 500 byte messages. Ping with packets of a standard length of 32 bytes can be performed without errors, and with long packets – with errors, which is typical for wireless connections with a low signal level in conditions of intense interference.

ping -n 1 -r 9 -w 1000 yandex.ru – ping 1 time (switch -n 1), issue a route for the first 9 hops (-r 9), wait 1 second (1000ms) for a response

As a result of executing this command, the route trace is also displayed:

In this example, a chain of 9 routers is built between the sender and receiver of packets. It is necessary to take into account the fact that in the version of the ping.exe utility for Windows, the number of transitions can take a value from 1 to 9. In cases where this value is not enough, the tracert command

is used

No ping is not always a sign of a problem, because sometimes, for security reasons, some hosts are configured to ignore pings sent by PING. An example is the microsoft.com host and some routers in small ISP networks.

Quite often, the PING command is used to organize delays in batch files. The loopback interface is pinged with the desired packet counter value specified by the -n option. Pings are sent at 1 second intervals, and the response on the loopback interface is almost instantaneous, so the delay will be approximately equal to the counter minus one:

ping -n 11 127.0.0.1 – 10 second delay.

ping 456.0.0.1 – ping to a non-existent address

The response to such a command may differ from the particular version of the utility, and
maybe something like this

Ping failed to find host 456.0.0.1. Check the hostname and try again.

ping yandex.ru – ping to the host address yandex.ru

Reply to ping of an accessible node:

Thus, to solve the problem of determining the availability of a node in a batch file, it is enough to analyze the characteristic words in the output of ping.exe with a successful response. The most characteristic in this case is the presence of the word TTL. It never occurs when an error occurs and consists of only English characters.
To search for “TTL” in the results of ping.exe, it is most convenient to chain its execution with the FIND character string search command. EXE (ping and find pipeline). If the text is found by the FIND command, then the value of the ERRORLEVEL variable will be 0

Full syntax and important keys of the PING command

To test the network, you can also use the commands:

Assignment of PING network test command

If there are problems with the network, the Ping command will help you find out the cause of the problem (and it does not matter whether it is a local network or the Internet). What is this team? Let’s try to understand and dig a little theory.

Run command line.

You can use one of the following methods to launch the command line:

Start – Run (or Win+R keys) type cmd and press Enter;

Start – All Programs – Accessories – Command Prompt”;

Start – Search – Command line.
Also, to launch the command line, you can use a pre-prepared shortcut that refers to the executable file %SystemRoot%system32cmd.exe (usually C:Windowssystem32cmd.exe). Execution of some commands requires elevated privileges, therefore, the command line application must be launched using the context menu item “Run as administrator”, called by the right mouse button.

tracert and traceroute commands

Tracing is another good method for diagnosing connectivity with a remote server. The point here is that during the trace, packets of test data are also sent to the server. The main difference from ping is that tracing makes it possible to see all the intermediate nodes through which packets pass from your PC to the final host.

Trace route in Windows 11

In the Windows 11 operating system, as well as in almost all previous versions – Windows 10 and older – tracing a route to a network resource is performed using the tracert utility integrated into the command shell.

To use it, open the command line again and write the command:

So we will start tracing from our PC to the Yandex server. Example:

Ping ya ru n 497349794379479

Now let’s look at the resulting trace result – it shows the entire route through which the request went to the site.

:/>  Полностью трансформировать и модифицировать

Each line in the trace is an intermediate host (usually a router). These knots are called jumps or “hops”.

In my case, 7 hops were made from my home computer to the yandex.ru site, passing through 5 intermediate nodes. On each of the jumps, the time is indicated for which the test packet reached this node and returned back.

Now let’s do one more trace — google.com. And here in the results we will have a very interesting moment:

Ping ya ru n 497349794379479

Namely, the line with “asterisks”. What do they mean? Many beginners are afraid of this and believe that this is a network problem. It’s not exactly like that! Asterisks indicate that no response was received from the server at this hop. Is it a problem? In this case, no. This is a technical site and does not respond to user requests.

The problem would be if after some of the hops all subsequent hops would end with asterisks, and the trace itself would end with nothing. Here in this case it is necessary to look for the reason. Most often, it is on the node that answered last. But it is not exactly)))!

How to trace in Linux

In operating systems of the Linux family, you can also do tracing. True, the command there is somewhat different: it is no longer tracert – the traceroute utility performs tracing. It starts in the same way as ping – from the console.

Some distributions do not have the traceroute utility installed by default. That’s why you need to install it. On Ubuntu b Debian this is done with the command:
$ sudo apt install traceroute
In RHEL and CentOS – with the command:
$ yum install traceroute -y

Otherwise, the use of this utility is not much different from how we did it in Windows 11. For example, let’s trace to Yandex. Team:

Ping ya ru n 497349794379479

As you can see, the result of route tracing is also given by hops. If a node did not answer, it is marked with “asterisks”.

A little theory about the Ping command

Ping is a response, the server’s response time to a request from your computer. In other words, this is the amount of time it takes for a packet sent from your computer to travel to another computer on the network and return back. Simply put, the PING command is used to check the availability of remote nodes and diagnose the quality of communication in the network.

PING is the main Windows command line utility for testing network connections in TCP/IP. The PING command, using ICMP echo request messages, verifies an IP-level connection to another computer that supports TCP/IP. After each transmission, a corresponding message with an echo reply is displayed.

Ping is probably the most common TCP/IP command among Windows users, used for troubleshooting and checking the ability to access the Internet.

The Ping command, run without parameters, displays help. Works equally well on all versions of Windows, including Windows 10.

PING – command for checking and diagnosing the network

Ping command in practice

What information does this command give us:

Server Response Time

Now let’s talk about server response time. This is the time from the moment a packet is sent to the moment a response is received from the server. This indicator is measured in milliseconds (ms). The smaller this value, the better the connection.

Response time values ​​(see screenshot below – average value 33 ms):

Command line setup.

Page dedicated to CMD settings

Working on the command line involves entering data from the keyboard, and sometimes quite a large amount. This volume can be significantly reduced using some tricks:

Using the clipboard.

The text selected in the application window can be copied to the clipboard, and it can also be pasted from the clipboard into the input field. With standard command line settings, the ”Mark” item of the context menu called by the right mouse button is used to select text. If desired, in the properties of the shortcut with which the launch is performed, you can enable the mouse selection mode:

Ping ya ru n 497349794379479

In mouse selection mode, the context menu is not used and text is selected using the left mouse button. Copying and pasting is performed by pressing the right mouse button.
When the ”Allow keyboard shortcuts with CONTROL” mode is on, you can use the standard keyboard shortcuts:

– CTRL+C (CTRL+Insert) – copy the selected text.

– CTRL+V (Shift+Insert) – paste the selected text.

Using command history and hotkeys.

To call up previously entered commands, use the arrow keys Up Arrow – one command back and Arrow Down – one command forward. In addition, function keys can be used:

F1 – character-by-character call of the last entered command. Each press of F1 leads to a sequential substitution in the input field of one character from the previous command.

F2 – copy up to character. After pressing F2, the screen displays a prompt for the character up to which the previous command will be copied. For example, if the previous command was ping yandex.ru, and a period was specified as a character, then ping yandex will be entered in the command input line, if a space is specified, then – ping.

F3 – call the previous command.

F4 – delete up to character. Deletes text from the current cursor position to the specified character.

F5 and F8 – calling the buffer of previously entered commands. The output by pressing the F5 key stops when the first entered command of the current session is displayed.

F7 – display previously entered commands in a separate window as a list. To execute the desired command, select it using the arrow keys and press ENTER

F9 – execute the command whose number is requested. The command number in the history list can be obtained by using F7.

Windows 10 / Windows Server 2016 introduces features not available in previous command line implementations:

– Changing the transparency of the console window when pressing CTRL+Shift+- or CTRL+Shift++ combinations.

– Enable / disable full screen mode when pressing CTRL+Enter.

– Enhanced text selection and editing:

Shift+Home – select text from the current cursor position to the beginning of the line.

Shift+End – select text from the current cursor position to the end of the line.

– Fast navigation through the screen buffer and search by context:

CTRL+Home – go to the beginning of the screen buffer

CTRL+End – go to the end of the screen buffer.

CTRL+Up Arrow – move 1 line up.

CTRL+Down Arrow – move 1 line down.

CTRL+F – open a text search dialog in the screen buffer.

The command line window in Windows 10 can be closed using the standard key combination – ALT+F4.

:/>  Как перенести папку загрузки с диска C на диск Д в Windows 7 — 10?

To disable the new features of CMD, you need to check the box “Use the old version of the console (requires a restart)” in the application properties

File Path Completion

In the Windows command line, you can perform file and directory substitution by pressing the Tab key. For example, to navigate to a directory with the long name Program Files, type the initial part of the directory name

CD Pro and press Tab. The command should appear in the input line:

CD “Program Files”

As you can see, the missing part of the directory name is substituted, and in cases where it contains a space character, double quotes are also added.

If there are multiple matching initial parts of file or directory names, each time you press the Tab key, the next name in alphabetical order will be substituted. To return to the previous one – use the combination Shift + Tab

Redirecting standard input / output of the console.

As already mentioned, the standard input device of the command line is the keyboard, and the display device is the output device. However, it is possible to redirect I/O to other devices using redirect operators:

< – input redirection. The data is not read from the keyboard, but from a file or other device.

cmd < 1.txt – launch the CMD command processor and enter data from file 1.txt. If you put the line ping –n 100 yandex.ru in the file, then the command discussed above will be executed.

Often, the output of one command needs to be passed as input to another, i.e. chain commands together:

Use of console I/O handles.

Each open file or device has its own handle (handle), which is a non-negative number, the value of which is used by the process that spawned the I / O stream. By default, for all processes, including the command interpreter cmd.exe :

0 ( STDIN ) – standard input descriptor (keyboard input).

1 (STDOUT) – standard output descriptor (screen output).

2 (STDERR) – descriptor for displaying diagnostic messages (error messages on the screen).

Descriptors can be used when it is required to redirect (change) data sources and destinations in standard input-output streams. For example:

To specify a redirect to existing descriptors, use an ampersand (&), then the number of the required descriptor (for example, &1):

Chaining multiple commands

& – A single ampersand is used to separate multiple commands on the same command line. For example:

&& – conditional execution of the second command. It will be executed if the exit code (whose value is passed to the standard variable ERRORLEVEL) of the first command is equal to zero, i.e. command completed successfully.

command1 && command2 – command1 is executed, and command2 is executed only if the first was executed successfully. For example:

ping ya.ru -err & ping –n 2 ya.ru – when using a single ampersand, the first command ping ya.ru –err will report an invalid parameter -err, and the second, ping –n 2 ya.ru will perform a double ping of the ya.ru node

ping ya.ru -err && ping –n 2 ya.ru – when using a double ampersand, the first ping ya.ru –err command will display a message about the invalid parameter -err and, accordingly, generate a non-zero exit code (error ), which will cause the second command ( ping ya.ru -n 2) to fail.

In some cases, it may be necessary to prohibit the processing of service characters and interpret them as plain text. For example, if you enter at the command line

then instead of the text ping -n 1 ya.ru & ping -n 2 ya.ru its part before the ampersand character ping -n 1 ya.ru will be displayed and then the command after the ampersand – ping -n 2 ya.ru will be executed . The problem is solved by using a special escape character ^ , which allows you to use service characters as text:

TYPE C:plan.txt && DIR & COPY /?

COPY /? will run in any case, regardless of the result of executing the TYPE C:plan.txt command. But, several commands can be grouped using parentheses. For example, there are 2 command lines:

TYPE C:plan.txt && (DIR & COPY /?)

In the first of them, the conditional processing symbol && acts only on the DIR command, in the second – on two commands at the same time: DIR and COPY. As a visual experiment, try running the second command under the conditions of the presence and absence of the C:plan.txt file. To create an empty file, you can use copy from the dummy device nul:

copy nul C:plan.txt

To delete a file, use the erase c:plan.txt or del C:plan.txt command

Command files

Other materials for mastering work in the Windows command line:

Windows Terminal is an alternative to the command line in Windows 10.

List of CMD commands with description and examples.

Windows command line setup.

Working with the network in the command line.

What can the Ping command help diagnose?

I want to tell you about another very useful utility for diagnosing network problems – MTR (My traceroute). It is available on all Linux distributions and combines the functionality of the two commands listed above: Ping and Traceroute. Like Traceroute, it outputs a complete trace of the route that network packets take to reach the desired host. In addition, real-time ping is conducted to each of the intermediate nodes to determine the response time of packet loss information at each step.
The MTR utility is still launched from the terminal with the mtr command. Example:

The result is:

Ping ya ru n 497349794379479

Sending test packages will go on forever. To stop diagnostics, press the key combination Ctrl+C.

In my example, the result shows that despite the presence of a technical node that does not respond, the destination server is available, and all sent packets (see the Snt column) go through to the destination node. In this case, the percentage of packet losses (see the Loss column) is equal to zero. Everything is fine!

Using the -r argument when entering the MTR command, you will receive the diagnostic result in the form of a report. The information will be printed to the Linux console.

WinMTR tracing in Windows 11

Ping ya ru n 497349794379479

Press the “Start” button and start the diagnostics. After a couple of minutes, we look at the result.

What is convenient, in this utility you can not only copy the results to the clipboard, but also immediately export them in text or HTML format, so that later they can be sent, for example, to the provider’s technical support.