DEV Community

Cover image for Let's learn about few networking side command in Linux/Unix
Payalsasmal
Payalsasmal

Posted on • Edited on

Let's learn about few networking side command in Linux/Unix

Hi There!
I was working on few network side commands. I thought to share this with you all😃. Here you go ✌️

1. netstat:
netstat stands for Network Statistics. This is very basic command used to print network connections, routing tables, interface statistics etc.

netstat details example

Syntax:

netstat [OPTIONS]
Enter fullscreen mode Exit fullscreen mode

There are various options which are supported by netstat command. Listing few of them in below

  • netstat -i: i stands for Interface.(Network Interface shows that how kernel links up with the software network side to the hardware network side).

Example:
netstat -i example

  • netstat -r: r stands for Routing. It will show kernel IP routing tables.

Example:
netstat -r example

2. nslookup:
nslookup stands for Name Server lookup. It helps us to check the IP address mapped to DNS(Domain Name System) and vice versa. This is very useful when we want to troubleshoot the DNS related issue.

nslookup

Syntax:

nslookup [OPTIONS]
Enter fullscreen mode Exit fullscreen mode

nslookup has two modes Interactive and Non-Interactive.

  • Interactive Mode: When we have various hosts and domains then we should use this mode.

Example:

nslookup interactive mode

  • Non-Interactive Mode: We can use this for single host or domain.

Example:
nslookup non-interactive mode

3. ping:
ping stands for Packet Internet or Inter-network Grouper. This command send a echo request to host network and when host network receive the request, it send an echo response through Internet Control Message Protocol(ICMP)

ping command

Syntax:

ping [OPTIONS]
Enter fullscreen mode Exit fullscreen mode
  • ping -i: i stands for Interval. Interval second between sending each packet.The default waiting interval sec is 1 sec while sending packet. We can customise that using this command.

Example:
ping interval

  • ping -w: Here w means deadline. How many packets do you want to send as request and get response. This command can help to number of packets delivery and automatically will be stopped once it is completed.

Example:
ping deadline

4. curl:
curl is used to transfer data to or from server using most of the protocols(HTTP,HTTPS,FTP,SMTP,TELNET etc).

Curl description

Syntax:

curl [OPTIONS]
Enter fullscreen mode Exit fullscreen mode

Note: we can use multiple options together. we will be seeing these in below examples

  • curl -o: o stands for output. We can write the output to a file.

Example:
curl output

  • curl -s: s stands for silent. WE can use it when we don't want to see the progress bar.

Example:
curl s

  • sending email: Use the below commands we can send the email. Note: If you have are using gmail and you have enabled 2 steps authentication google will not allow you to do that from non-Google app. You might get the security alert 🔒 from google.

Example:
Sending email through curl

mail.txt has below details:
curl mail.txt file

5. ssh:
ssh stands for Secure Shell. It is used for logging into the remote machine and execute the commands on remote machine.

Syntax:

ssh [OPTIONS]
Enter fullscreen mode Exit fullscreen mode

ssh -i: i stands for identity file. It selects a file for public key authentication.🔐

Example:
It will connect to remote ubuntu server.

ssh i

server_key: This is the public key of the server
ubuntu: Server name
34.208.206.133: server ip address.

Note: For every command do man <command> and <command> --help for more info
Enter fullscreen mode Exit fullscreen mode

Hope you like this articles🥰,I would love to connect on GitHub Twitter Linkedin

Top comments (0)