-->

5 Network Commands For Linux Terminal

5 Network Commands For Linux Terminal

5 Network Commands For Linux Terminal


 Surely people realize that working using the Command Line has many advantages compared to working on 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. The following are 5 Network Commands for the Linux Terminal that you can use. But some commands may require administrative privileges, so make sure you have root access by typing the sudo command.



1. Pings


The ping command is used to quickly start diagnosing network problems, find the IP address of devices on the network, or even monitor the speed of your network.


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 pings to six replies. If you decide to run the following command.


ping google.com


The 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 the 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 have happened and your cursor will just blink continuously. However, two things happen in this command. There is an infinite ping running and it is passing the output from 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 why the -O option is used when you have an infinite ping running, and feed the output to a text file, and while it's running you unplug and reconnect the network cable a few times. This will simulate dropping the connection, and increasing the connection back. To view the contents of the text file you can run the following command:


nano dataping. txt

ping -O google.com > dataping.txt


The above information displayed in the text file clearly shows where the network connection is dropping. 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 attempts at addresses on the internet show some dropped packets. It could be a strong possibility that your computer's hardware is fine, but internet-connected devices may need further checking.


2. Check the 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. The following is the command:


ip address show

The Linux Show IP Address Command


Obviously, this command shows you the IP address of every interface that your device has. Dab This will be the main command used to override ifconfig:


ip link set DEVICE down


ip link set DEVICE up

Command IP Link Set DEVICE Down Or Up


Similar to ifconfig DEVICE down or ifconfig DEVICE up you can set your device state up or down. Simply replace DEVICE with the interface you want to change the state of.


3. Download Files From the Internet


Maybe when downloading files on Windows, we have to visit the site first and click on the download link. But on Linux you can use the CLI to download the file, using the curl or wget command, you can easily download the file.


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 on Linux CLI


Actually the two commands above will give you the same result. Wget has a major strong side in that it downloads recursively compared to curl . Although curl supports more Protocols i.e. 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 make your DHCP issue you a new IP Address based on how it is configured.

The Linux dhcpclient command


5. Get Information Regarding Websites


To get information about your website, you can use the whois command. It's very useful to be able to view website notes right from the command line. To install whois run the following command:


apt-get update


apt-get install whois


After installing whois, you can query any domain name to get more information:


whois schemafix.com


Whois Command In Linux CLI Conclusion


So those were 5 Network Commands for the Linux Terminal which can make things easier for you because text commands are more efficient for network problems than you have to click one by one.


Also, read the article about 5 Best Cache Plugins For WordPress (Free). And see you in another article. Bye
Read Also :
DotyCat - Teaching is Our Passion