Calculator with awk

In your bash, do the following

1
calc(){ awk "BEGIN{ print $* }" ; }

and then do the following:

2
calc 2*1 - 12

or

3
calc '2*(1 - 12)'

you can put this in your ~/.bash_profile too

Command – traceroute

Traceroute is a command which can show you the path a packet of information takes from your computer to one you specify. It will list all the routers it passes through until it reaches its destination, or fails to and is discarded. In addition to this, it will tell you how long each hop from router to router takes.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[root@sjc14-esx2-vm3 ~]# traceroute iph.csi2.c3w.tv
traceroute to iph.csi2.c3w.tv (192.118.77.180), 30 hops max, 40 byte packets
 1  172.29.96.1 (172.29.96.1)  3.150 ms  3.141 ms  3.135 ms
 2  sjc14-00lab-gw1-gig1-4.cisco.com (172.24.114.181)  3.120 ms  3.105 ms  3.094 ms
 3  sjc12-lab4-gw1-ten6-7.cisco.com (172.24.95.29)  3.086 ms  3.078 ms  3.067 ms
 4  sjc5-sbb4-gw1-ten8-6.cisco.com (171.71.241.174)  3.049 ms  3.045 ms  3.037 ms
 5  sjc12-rbb-gw4-ten7-4.cisco.com (171.71.241.254)  3.003 ms  2.997 ms  2.988 ms
 6  sjc12-gb1-ten2-2.cisco.com (10.112.4.157)  2.974 ms  3.924 ms  3.914 ms
 7  capnet-rtp10-sjc12-10ge.cisco.com (10.112.4.162)  78.649 ms  78.646 ms  79.351 ms
 8  rtp5-rbb-gw1-ten4-6.cisco.com (10.112.4.106)  81.145 ms  81.143 ms  81.863 ms
 9  rtp5-gb2-ten2-1.cisco.com (10.112.3.77)  79.921 ms  79.917 ms  79.911 ms
10  capnet-amsidc-rtp5-oc48.cisco.com (10.112.4.114)  167.285 ms  167.277 ms  167.263 ms
11  amsidc-rbb-gw2-ten2-1.cisco.com (10.112.4.202)  167.197 ms  167.194 ms  166.839 ms
12  amsidc-wan-gw1-ten6-2.cisco.com (144.254.78.14)  168.174 ms  167.671 ms  167.639 ms
13  amsidc-cw-pe1-oc48.cisco.com (10.61.40.18)  167.006 ms  167.087 ms  167.075 ms
14  ntn01-wan-gw1-ser1-0.cisco.com (144.254.136.193)  256.178 ms  256.308 ms  256.298 ms
15  ntn01-bb-gw2-gig2-7.cisco.com (64.103.115.205)  255.074 ms  254.828 ms  255.553 ms
16  ntn01-corp-gw1-gig0-2.cisco.com (64.103.116.14)  254.310 ms  254.302 ms  254.297 ms
17  ntn01-dmzbb-gw1-gig2-43.cisco.com (192.118.78.166)  260.572 ms  260.568 ms  257.431 ms
18  ntn01-dmznet-gw1-gig1-1.cisco.com (192.118.78.86)  254.664 ms  254.664 ms  254.655 ms
19  ntn01-dmzlab-gw1-gig1-1.cisco.com (192.118.76.26)  256.993 ms  257.295 ms  256.258 ms
20  csi-scp-dmz-gw.cisco.com (192.118.76.106)  257.160 ms  257.138 ms  256.874 ms
21  csi-scp-dmz-gw.cisco.com (192.118.76.106)  257.300 ms !X * *