10 Commonly use command in Shell/Bash Scripting

Below listed 10 commands will help you with shell scripting.

1. cat :

This command will show all the file content.
This can be used to read content of zip files too only by adding required prefix to "cat" command.

Example: You want to read content of file1.txt and  file2.zip.

>> cat file1.txt

>> zcat file2.zip

2. cd :

This command will change directory.
This can also be used to return back to home directory.

Example: If you want to go to  directory1. Once you reach directory one you can just type cd and it will take back to home directory.

>> cd /directory1

3. mkdir :

This command creates new directory.

Example: You want to create new directory name D1.

>> mkdir D1

4. cp/mv : 

Command cp/mv will create copy of file to another directory. However, when we use mv it will delete the original file.

Example: You want to copy file1 to location /new while only move file2 to location /new.

>> cp file1 /new

>> mv file2 /new

5. rm :

This will remove/delete file and directory.

Example: You want to remove file1.

>> rm file1

6. grep:

This command will help to search specific word in file.
Please click on below link to find more about grep command.
Example: You want to search echo in file1

>> cat file1 | grep "echo"

7. ls:

This command will get the list of available file & directory in a folder.

8. tail :

This command is used to print the last/recent lines from the file. N is the user input which states number of lines and need to be provided along with command.

Example - You want to see recent/last 5 lines of new created file1.

>> tail -5 file1.

9. less :

This command allows user to only view the file. "shift+G" to read last line and "G" to read first line of the opened file.

10. chmod :

This command is used to modify the access/permission of a user

5 things you must know about TCP in Network Domain

1. TCP stands for Transmission Control Protocol. 

Name of protocol itself suggests that its related to network communication. TCP is widely know protocol which is also known as standard in defining the network management applications.

2. TCP provides error checking and recovery mechanism.

In Network Communication these are two most import feature and end user would like to consider before implementing protocols. It has a checksum in header which enable error checking. Having these capability makes it most reliable protocol.

3. TCP provides Congestion and Flow Control.

Large amount of data is handled using algorithms thus avoiding the data congestion. Also Flow control is handled by  excellently using flag bit and acknowledgement Number in header.

4.  Bandwidth management.

Bandwidth Management is taken care by using concept of Window Size to suffice the requirement. Here Acknowledgement Number bits and Sequence Number bits plays most important role. TCP uses slow start phase by using window size 1 and increases the window size exponentially after each successful communication. 

5. Multiplexing.

TCP Multiplexing is used in order to enable client system to receive multiple connection over single virtual connection

Routing Protocols Basics


IGP – Interior Gateway Protocol
EGP – Exterior Gateway Protocol
BGP – Border Gateway Protocol
RIP – Routing Information Protocol
IGRP – Interior Gateway Routing Protocol
OSPF – Open Shortest Path First (Click this link for more details on OSPF)
ISIS – Intermediate System to Intermediate System
EIGRP – Enhanced Interior Gateway Routing Protocol

Routing protocol :

Routing protocol specifies how router communicate with each other and distribute information that enable them to select the route for traffic flow. Routing protocol are configured on routers with a purpose of exchanging routing information. 

Static Routing Protocol : 

Static routing are manually configured by Network administrator by adding fixed entries in to routing tables. It is also known as non-adaptive routing since it doesn't change routing table unless the network administrator modifies it manually. This protocol does not uses complex algorithm for routing but it definitely provides high security compared to dynamic routing protocols.

Dynamic Routing Protocol :

Dynamic routing is when routing protocols is used to figure out best path for traffic flow. Its an adaptable routing protocol as it has ability to update routing table whenever there is change in topology or network, these modification in routing table are done with help of protocols like OSPF, ISIS, BGP, etc.This routing protocol uses complex algorithm but does not provide very high security like static routing protocol.
When the network/topology changes,it sends message to router for ensuring that changes are recalculated and are send for updating routing tables.

Default Routing Protocol :

This is the routing method where all routers are configured to send all packets towards a single router. However, its usually combined with static protocol or dynamic protocol. These protocols are mostly used in small networks or for network with single entry and exit points. 

OSPF, LSR, LSA & LS-DB Everything you must know !!

Link State Routing Protocol:

  • Link state protocols are based on Shortest Path First (SPF) algorithm to find the best path to a destination.
  • Shortest Path First (SPF) algorithm is also known as Dijkstra algorithm, since it is conceptualized by Dijkstra.

LS-DB [Link-State Data Base] Tables:

  • OSPF is link state protocol and when configured it will collect available data to develop a map of all paths available in its network, this data is later saved in its db which is known as LS-DB.
  • LS-DB is collection of all OSPF LSA's received.
  • The information stored in this LS-DB is used to calculate the shortest path using SPF algorithms.
  • Each OSPF router has identical LS-DB.
  • LS-DB are exchanged between neighboring routers soon after they are discovered as neighbors.
  • The information is propagated in DB tables of single OSPF Area.

LS-DB includes below tables :

Neighbor Table → Which contains details of discovered OSPF neighbor.
Topology Table → Which contains details of entire topology map within OSPF area and is also use to calculate the alternate & best paths.


Routing Table → Which contains details of presently being used the best working path which can be forwarded to neighboring routers.
  • All routers in same Area share single topology table, but different routing tables.
  • This is only because OSPF calculates separate best paths for each router on basis of its location in the topology, while all router share the same Link State Topology Table.
  • This helps the topology table to be in sync with each and every available router in network.


What is LSA and how does it helps router to communicate ?

  • LSA stands for Link State Advertisement is basic communication means of OSPF routing protocol for the internet protocol (IP).
  • OSPF uses LS-DB and fills this with LSA.

OSPF uses LSR potocols via LSA.

  • In Shortest Path First (SPF) algorithm, whenever a link's state changes, a routing update called a Link-State Advertisement (LSA) is exchanged between routers.
  • When a router receives an LSA routing update, the link-state algorithm is used to recalculate the shortest path to affected destinations.
  • Each router constructs a map of the complete network. An example of Link State protocol is OSPF.