Dipesh Majumdar

Blog and Paintings

Some useful Linux Commands - 2

New things learnt... these are the things i didn't know... Mostly we will cover a few network-related commands  

  1. suppose there are three files - aaa aaaa aaaaaa

    i didnt know : 

    ls aa?   would return only aaa

    i only knew aa* will return all three files


  2. ping -c4   would give you only 4 lines - didn't know that

  3. didnt know we had 2 types of listerners - tcp and udp 

    tcp is returned by - netstat -ntl 

    and udp by netstat -nul

    netstat -ntlp and netstat -nulp will give the tcp and upd listerners along with the programs

  4. netstat -r gives the routing table 

    and here you can see your default gateway - the flag for which should be UG

    netstat -nr can be used as well

    and since we get the default gateway - we know the ip now through which the server opens up to the world. You can also see the default gateway this way: cat /etc/sysconfig/network

  5. traceroute - will keep hopping - first entry will be the default gateway which is pretty interesting

    and in windows cmd prompt - one should use tracert in place of traceroute!!!!

Go Back