# Basic Networking command in Linux/Unix

- Link: https://technotaught.com/basic-networking-command-in-linux-unix/
- Published: 2019-02-23T13:58:18+05:30
- Author: Ashishkumar Vishwakarma

## Basic networking commands

 Basic networking commands (such as tracert, traceroute, ping, netstat, ipconfig,
hostname, tcp dump and nslookup) . And their arguments, options and parameters in
details including how they are used to troubleshoot the computer network.

![](https://technotaught.com/wp-content/uploads/2019/02/image.png)

networking command of unix/linux

#### **Ifconfig**: -Getting network configuration.

 * **Ifconfig** stands for “interface configuration” .
 * One of the most basic networking commands is **ifconfig**.
 *  View network configuration, it displays the current network adapter configuration.
   It is handy to determine if you are getting transmit (TX) or receive (RX) errors.
 *  It will tell you about your network interfaces, the state that they’re in, your
   assigned IP address, and even provides some counts of packets that have crossed
   the interface since the system was last booted. These days, you may see both 
   ipv4 and ipv6 addresses.
 * The RX (receive) and TX (transmit) packets counts as well as the same basic statistics
   shown in bytes.
 * These numbers may seem huge, but the system was running for roughly a year.

![](https://technotaught.com/wp-content/uploads/2019/02/ifconfig.png)

ifconfig command

#### **Ping: -T**est network connection**.**

 * The **ping** command sends an echo request to a host available on the network.
 * Using this command, you can check if your remote host is responding well or not.
 * Tracking and isolating hardware and software problems.
 * Determining the status of the network and various foreign hosts.
 * Testing, measuring, and managing networks.
 * **Syntax: –**Following is the simple syntax to use the ping command − $ping hostname
   or IP-address. The above command starts printing a response after every second.
 *  Example: -$ping google.com

![](https://technotaught.com/wp-content/uploads/2019/02/ping.png)

#### **Netstat**: -Network connections, routing tables, interface statistics.

 *  The netstat command can tell you about **ongoing connections on the local system
   and ports **(i.e., services) that are listening, indicating that services are
   waiting for requests to come through.
 * By itself, netstat gives you a lot information. With –a option, it gives you 
   even more.

![](https://technotaught.com/wp-content/uploads/2019/02/netstate.png)

netstate command

#### **Traceroute: – routing steps it takes to reach the remote host **

 * A handy utility to view the number of hops and response time to get to a remote
   system or website is traceroute. Again, you need an internet connection to make
   use of this tool.
 * The traceroute command will attempt to provide a list of all the routers your
   connections, cross when reaching out to a remote system.
 * The output also provides some information on how long each segment of the path
   takes, thus giving you some notion of the quality of a connection.
 * If traceroute gets to aa point at which it is unable to provide further information,
   you will start to see asterisks where you used to see system names and timing.

![](https://technotaught.com/wp-content/uploads/2019/02/traceroute.png)

traceroute command

#### **Nslookup: – **Query DNS lookup name.

 *  If you know the IP address it will display hostname.
 * To find all the IP addresses for a given domain name, the command nslookup is
   used.
 * You must have a connection to the internet for this utility to be useful,
 * Example: –   $ **nslookup blogger.com**

![](https://technotaught.com/wp-content/uploads/2019/02/nslook.png)

nslookup command

#### **Hostname: – f**inding host/domain name and IP address.

 * Generally, you know the name of the system you’re logged into.
 * Here are some hostname command options that you might not be using.

 * Example: –
 * hostname with no option displays the machine’s hostname.
 * hostname -d displays the domain name the machine belongs to.
 * hostname -f displays the fully qualified host and domain name.
 * hostname –i displays the IP address for the current machine. The –i option provides
   and easy way to grab the system’s IP address without having to separate it from
   it ifconfig output.

 * ![](https://technotaught.com/wp-content/uploads/2019/02/hostname.png)
 * hostname command

**whois**

 * You can often find a lot more information about a domain using the whois command,
 * Example; – $ whois valero.com.
 * It is queried and response protocol.

![](https://technotaught.com/wp-content/uploads/2019/02/who.png)

who command

**tcpdump**

 Type of packet analyzer software utility  that monitors and logs tcp/IP traffic
between network and computer.

 The **tcpdump** command can print out the headers of network packets as they reach
your server or can be used with various filters to select just the packets you want
to see.

Install using install tcpdump.

 * Capture packets from specific interface
   tcp –i eth0 :Display available interfacesTcpdump–
   d :Read captured packets in fileTcpdump –r abc.pcap :Capture packets from ip 
   sourceTcpdump –i eth0 src 192.168.0.2                           **

![](https://technotaught.com/wp-content/uploads/2019/02/tcpdump_command.jpg)

You can also refer basic commands in linux by clicking below.

[Refer Linux Commands](https://technotaught.com/study-of-general-commands-of-ubuntu/)

[ Refer Command of VI-Editor ](https://technotaught.com/command-of-the-vi-editor-and-implement-them/?preview=true&_thumbnail_id=2397)

### Share this:

 * [  X ](https://technotaught.com/basic-networking-command-in-linux-unix/?share=twitter)
 * [  Facebook ](https://technotaught.com/basic-networking-command-in-linux-unix/?share=facebook)
 * [More](https://technotaught.com/basic-networking-command-in-linux-unix/#)

 * [  WhatsApp ](https://technotaught.com/basic-networking-command-in-linux-unix/?share=jetpack-whatsapp)
 * [  LinkedIn ](https://technotaught.com/basic-networking-command-in-linux-unix/?share=linkedin)
 * [  Email ](https://technotaught.com/basic-networking-command-in-linux-unix/?subject=%5BShared%20Post%5D%20Basic%20Networking%20command%20in%20Linux%2FUnix&body=https%3A%2F%2Ftechnotaught.com%2Fbasic-networking-command-in-linux-unix%2F&share=email)
 * [  Reddit ](https://technotaught.com/basic-networking-command-in-linux-unix/?share=reddit)
 * [  Tumblr ](https://technotaught.com/basic-networking-command-in-linux-unix/?share=tumblr)
 * [  Pinterest ](https://technotaught.com/basic-networking-command-in-linux-unix/?share=pinterest)
 * [  Telegram ](https://technotaught.com/basic-networking-command-in-linux-unix/?share=telegram)
 * [  Print ](https://technotaught.com/basic-networking-command-in-linux-unix/#print?share=print)

### _Related_

## Comments

### By: easynotesforyou

- Link: https://technotaught.com/basic-networking-command-in-linux-unix/#comment-23
- Published: 2019-02-27T00:11:53+05:30

👍👍
