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
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
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.
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.
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.
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.
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:
The command output "link beat detected" (Heartbeat connection detected) indicates that a network cable is plugged in, and if not, the "unplugged" is output (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.
Copy Code
The code is as follows:
Ifconfig ifconfig eth0
Ifconfig
9.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.
Copy Code
The code is as follows:
sudo ifdown eth0 sudo ifup eth0
Ifdown-ifup
Running these 2 commands on a Linux desktop system is likely to output an error message. 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.
Copy Code
The code is as follows:
sudo dhclient-r sudo dhclient
Dhclient
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.
Netstat
This command also has a lot of features. For example, the NETSTAT-P command can display the program that corresponds to an open socket.
Netstat-p
NETSTAT-S displays detailed statistics for all ports.
This article is from the "Cool bit Linux" blog, so be sure to keep this source http://coolbyte.blog.51cto.com/8289854/1698180
11 network commands that must be known under Linux