Networking Commands in Linux Print

  • #webanchor #Linux #networking
  • 2

ping

The 'ping' command stands for Packet Internet Groper. It is used to test the network connections between two computers and to see if a host is reachable.

So how does it work? Well, the 'ping' command uses something called ICMP, which stands for Internet Control Message Protocol. It sends an ICMP echo request message to the IP address you request. If the connection is successful, it responds with an ICMP echo reply message. You will know the host is reachable if you get the ICMP echo reply message

$ ping webanchor.net

 

dig

The 'dig' command can be used to view information about the Domain Name Servers of a website. It stands for "Domain Information Groper". Besides name servers, you can also view information about host addresses and mail exchanges. While anyone can use this command, it's mostly used by System Administrators.

$ dig webanchor.net

whois

The 'whois' command is another basic command that is used to look up information. In this case, using whois will give you details about a domain, such as owner information.

Check out the screenshot to see what it shows you:

$whois

 

hostname

This command is as it says. If for any reason you need to use it, it just tells you what the hostname is.

$hostname

ip a

The 'ip a' command is among a couple you can use to find your IP address. Of course, knowing what your IP address is, is important.

You can also use the IP command to view certain things. Such as 'ip link', this command will display link layer information.

$iP a

finger

The 'finger' command shows you the details of all users who are logged in. This is a great command for sysadmins as well as they can see things such as exact login times and even emails of users. In order to use this command, you may need to install it. To do so, run 'sudo apt-get install finger'

$ finger

netstat -a

Another useful command is 'netstat'. In this case, I am using 'netstat -a' to list all the ports that are listening.

A listening port is when your machine is ready to accept a connection on that port. You can close and open ports at anytime.

$netstat -a

traceroute

The 'traceroute' command displays the route a packet took to reach the host. If you look at my screenshot below, you can see how many 'hops' it took for me to reach the requested host. A hop happens when a packet is passed from one network segment to the next network segment

$traceroute webanchor.net


Was this answer helpful?

« Back

Powered by WHMCompleteSolution