basic commands for viewing network performance in a Linux environment
because Linux often uses a character interface, and Linux is more powerful, with default routing capabilities, which are equivalent to gateways and routers. The network performance is also relatively stable, and simple configuration. Of course, when configuring the network may occur when the network connectivity is unstable or does not pass. The order may be of some help to you:
1.curl & wget
with the curl or wget command, you can download files without leaving the terminal. If you use Curl, type Curl-o followed by a file path. Wget does not require any options. The downloaded file is in the current directory.
Curl-o website.com/file wget Website.com/file
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/91/AD/wKioL1j3aS7Bj5T2AAEgGxtsoks422.png-wh_500x0-wm_ 3-wmp_4-s_1470883887.png "title=" image 1.png "alt=" Wkiol1j3as7bj5t2aaeggxtsoks422.png-wh_50 "/>
2.ping
Ping sends the Echo_request package to the address you specify. This makes it easy to verify that your computer and the Internet or a specified IP address are not. With the-c switch, you can specify the number of Echo_request packets to send.
Ping-c 4 google.com
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/91/AD/wKioL1j3aUfzsw7kAAJuPdfE9SM045.png-wh_500x0-wm_ 3-wmp_4-s_2043369140.png "title=" image 2.png "alt=" Wkiol1j3aufzsw7kaajupdfe9sm045.png-wh_50 "/>
3.tracepath & Traceroute
The Tracepath command is similar to the traceroute command, but does not require root privileges. and Ubuntu preinstalled This command, the traceroute command is not preinstalled. Tracepath tracks the network path to the specified destination address and gives each hop (hop) on the path. If your network has problems or is slow, tracepath can find out where the network is broken or slow.
Tracepath example.com
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/91/AE/wKiom1j3aV3zPj7CAACOSjrIZKI197.png-wh_500x0-wm_ 3-wmp_4-s_494948110.png "title=" image 3.png "alt=" Wkiom1j3av3zpj7caacosjrizki197.png-wh_50 "/>
4.mtr
The MTR command synthesizes a ping command with the Tracepath command. The MTR will continue to contract and show the time spent on each ping. Any problems in the process are also displayed, in the following example, you can see that the 6th hop lost more than 20% of the package.
MTR howtogeek.com
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/91/AE/wKiom1j3aXixrPVFAAKw45p3AtU190.png-wh_500x0-wm_ 3-wmp_4-s_2064112104.png "title=" image 4.png "alt=" Wkiom1j3axixrpvfaakw45p3atu190.png-wh_50 "/>
type Q or CTRL + C to exit the command.
5.host
The host command is used to do DNS queries. If the command parameter is a domain name, the command outputs the associated IP, and if the command argument is IP, the command outputs the associated domain name.
Host Howtogeek.com host 208.43.115.82
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/91/AD/wKioL1j3aY-DzcqNAAJwGYQzYwM662.png-wh_500x0-wm_ 3-wmp_4-s_309538378.png "title=" image 5.png "alt=" Wkiol1j3ay-dzcqnaajwgyqzywm662.png-wh_50 "/>
6.whois
The WHOIS command outputs the WHOIS record for the specified site and can see more information such as who registers and holds this site.
Whois example.com
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/91/AD/wKioL1j3aajz5RrAAAHkmcyFSsc903.png-wh_500x0-wm_ 3-wmp_4-s_715951357.png "title=" image 6.png "alt=" Wkiol1j3aajz5rraaahkmcyfssc903.png-wh_50 "/>
7.ifplugstatus
The Ifplugstatus command can tell you if a network cable is plugged into the interface. This command Ubuntu is not preinstalled and is installed by the following command:
sudo apt-get install Ifplugd
This command can view the status of all network interfaces, or specify the status of the network interface:
Ifplugstatus ifplugstatus eth0
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/91/AE/wKiom1j3acPR3vVIAACG1zKUjs4608.png-wh_500x0-wm_ 3-wmp_4-s_1218447687.png "title=" image 7.png "alt=" Wkiom1j3acpr3vviaacg1zkujs4608.png-wh_50 "/>
command Output " Link beat detected "(connected heartbeat detected) indicates that a network cable is plugged in, and if not, it outputs" unplugged "(not inserted).
8.ifconfig
The ifconfig is used for various options for output network interface configuration, tuning, and Debug. You can quickly view the IP address and other network interface information. Type ifconfig to see the status of all enabled network interfaces, including their names. You can specify the name of the network interface to display only information for this interface.
Ifconfig ifconfig eth0
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/91/AD/wKioL1j3adfiQ-szAAJt72a04sk105.png-wh_500x0-wm_ 3-wmp_4-s_2645702077.png "title=" image 8.png "alt=" Wkiol1j3adfiq-szaajt72a04sk105.png-wh_50 "/>
7.ifdown & Ifup
The Ifdown and Ifup commands are the same as the functions that run ifconfig up,ifconfig down. The name of a given network interface can only be disabled or enabled for this interface. Requires root access, so you need to use sudo to run on Ubuntu.
sudo ifdown eth0 sudo ifup eth0
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/91/AE/wKiom1j3afOQTW8FAADrcomoSHk594.png-wh_500x0-wm_ 3-wmp_4-s_4085299852.png "title=" image 9.png "alt=" Wkiom1j3afoqtw8faadrcomoshk594.png-wh_50 "/>
in the Running these 2 commands on a Linux desktop system is likely to output error messages. The Linux desktop manages your network interfaces by using the network Manager (NetworkManager). However, these 2 commands are still available on the server edition where Network Manager is not installed.
If you do want to configure Network manager on the command line, use the NMCLI command.
10.dhclient
The dhclient command frees up the IP address of your computer and obtains a new one from the DHCP server. Requires root access, so sudo is required on Ubuntu. No option to run the command to get a new IP, or to specify the-r switch to release the current IP address.
sudo dhclient-r sudo dhclient
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/91/AD/wKioL1j3ahCBFL7xAACiSyfg-yw692.png-wh_500x0-wm_ 3-wmp_4-s_2063760088.png "title=" image 10.png "alt=" Wkiol1j3ahcbfl7xaacisyfg-yw692.png-wh_50 "/>
11.netstat
The netstat command can display many statistics for a network interface, including open sockets and routing tables. The no option Run command displays the open socket.
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/91/AE/wKiom1j3aiWiZ-o6AAHYEOLdfOo765.png-wh_500x0-wm_ 3-wmp_4-s_2344126136.png "title=" image 11.png "alt=" Wkiom1j3aiwiz-o6aahyeoldfoo765.png-wh_50 "/>
This command also has a lot of features. For example,the NETSTAT-P command can display the program that corresponds to an open socket.
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/91/AD/wKioL1j3ajvC7-fiAAGu0ur9EBs495.png-wh_500x0-wm_ 3-wmp_4-s_113166609.png "title=" image 12.png "alt=" Wkiol1j3ajvc7-fiaagu0ur9ebs495.png-wh_50 "/>
NETSTAT-S displays detailed statistics for all ports.
This article is from the "Apache" blog, make sure to keep this source http://xiaorenwutest.blog.51cto.com/12754924/1917533
Basic commands for viewing network performance in a Linux environment