5 Network Commands For Linux Terminal
5 Network Commands For Linux Terminal
Network Commands For Linux Terminal
Surely people realize that working using the Command Line has many advantages over working in a Graphical User Interface (GUI). That's because the CLI is almost always faster than the GUI. For Linux users the Command Line is useful for making the work process concise. Here are 5 Network Commands For Linux Terminal that you can use. But some commands may require administrative privileges, so make sure you have root access by typing sudo command.
Also Read: The Difference Between Linux Desktop Environment Types And Which Is Best
TABLE OF CONTENTS
1. 1. Ping
2. 2. Check IP Address
3. 3. Download Files From the Internet
4. 4. Get a New IP Address
5. 5. Get Information About Website
6. Conclusion
1. Ping
The ping command is used to quickly start diagnosing network problems, find IP addresses of devices on the network, or even monitor your network speed.
ping -c 6 google.com
Command Ping -c 6 google.com
In the above command you can see the IP address that responded to the request along with the time it took to respond. The -c 6 option will limit the ping to six replies. If you decide to run the following command.
ping google.com
Ping will run indefinitely, until you decide to stop it. This can be done by pressing Ctrl + C on your keyboard.
The reason you want to let ping run for a long time could be to monitor the network connection between two devices. Or even between the computer and the internet. For this problem, you can run the following command:
ping -O google.com > dataping.txt
After you run this command, nothing seems to happen and your cursor will just blink continuously. However, two things happen in this command. There is an unlimited ping running and it is entering the output of the ping command to a file called dataping.txt in the same directory. This file can be opened and perform further investigation of the network.
Because by default the ping command will not appear when there is no reply. That's what the -O option is used for when you have unlimited pings running, and puts the output in a text file, and while it's running you unplug and reconnect the network cable several times. This will simulate the connection drop, and the connection increase again. To view the contents of a text file you can run the following command:
nanodataping.txt
ping -O google.com > dataping.txt
The above information displayed in the text file clearly shows where the network connection dropped. If you are experiencing strange network issues, this simple experiment can help you eliminate certain possibilities. For example, if you let a ping run against a device on your local network and there is no reply or response, but the same test of addresses on the internet shows some dropped packets. This could be a strong possibility that your computer hardware is fine, but internet-connected devices may need to be checked further.
2. Check IP Address
The ifconfig command is used to find the IP address of your device. But there are other commands that are cooler and full-featured. Here is the command:
ip address show
Show Linux IP Address Command
Obviously, this command shows you the IP address of each interface your device has. The Dab This will be the main command used to override ifconfig:
ip link set DEVICE down
ip link set DEVICE up
IP Link Command Set DEVICE Down Or Up
Similar to ifconfig DEVICE down or ifconfig DEVICE up you can set the state of your device up or down. Just replace DEVICE with the interface you want to change the status of.
3. Download Files From the Internet
Maybe when downloading a file on Windows, we should visit the site first and click on the download link. But on linux you can use the CLI to download the file, by using the curl or wget command, you can download the file easily.
curl -O https://www.openssl.org/source/openssl-1.0.2o.tar.gz
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
Download Files in Linux CLI
Actually the above two commands will give you the same result. wget has a major strong side which is that it downloads recursively as opposed to curl . Although curl has more protocols supported namely FTP, FTPS, Gopher, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, POP3, IMAP, SMB/CIFS, SMTP, RTMP, RTSP. While wget supports HTTP, HTTPS, and FTP.
4. Get a New IP Address
If you want to give up your IP address and issue a new one from the DHCP server, you can use the dhclient command:
dhclient device -r
Using dhclient with the -r option will release the dhcp IP Address first:
dhclient device
Omitting the -r option will have your DHCP issue you a new IP Address based on how it was configured.
Linux dhcpclient command
5. Get Information About Website
To get information about the website you can use the whois command. It is very useful to be able to view website records directly from the command line. To install whois run the following command:
apt-get update
apt-get install whois
After installing whois, you can ask any domain name to get more information:
whois monitortechnology.com
Whois Command In Linux CLI Conclusion
So that was the 5 Network Commands For Linux Terminal that can make it easier for you because text commands are more efficient for network problems than you have to click one by one.
__________________________________________________________________________________________________________________________________________________________________________________________________________________ ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ _________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ ________________________________________________________________________________________________ ________
Hopefully, this article about 5 Network Commands For Linux Terminal, gives you a little insight. Also, read an article about 5 Reasons to Choose Linux CLI Over GUI that you may need to know. Thank you.