How to get routing table in terminal [duplicate]

Try

netstat -r

Note that this will resolve the names of the gateways if possible. This takes some time. If you don't need this, run

netstat -rn