by djsumdog · 6y ago · 0 comments
alias ipa 'ip -br -color a'
alias ipl 'ip -br -color link'
Night and day! I try to not use the aliases because I'm often on servers without them, but the options for brief and color with the command to list adapters or links at the end it one all sys admins should memorize. It returns output that isn't terrible.According to the manpage, -color can be shortened to -c and link shortened to `l`, as `addr` can be shortened to `a`. -br stands for -brief, which knowing makes it easier to remember.
ip -br -c a
ip -br -c l
Now I need the aliases less.In case somebody is wondering the output looks like:
$ ip -br -color a
eth0 x.x.x.x/16 xxxx::xxxx:xxxx:xxxx:xxxx/64
lo 127.0.0.1/8 ::1/128
wifi0 x.x.x.x/24 xxxx::xxxx:xxxx:xxxx:xxxx/64
wifi1 x.x.x.x/16 xxxx::xxxx:xxxx:xxxx:xxxx/64
wifi2 x.x.x.x/16 xxxx::xxxx:xxxx:xxxx:xxxx/64
$ ip -br -color link
eth0 xx:xx:xx:xx:xx:xx <>
lo 00:00:00:00:00:00 <LOOPBACK,UP>
wifi0 xx:xx:xx:xx:xx:xx <BROADCAST,MULTICAST,UP>
wifi1 xx:xx:xx:xx:xx:xx <>
wifi2 xx:xx:xx:xx:xx:xx <> alias ip='ip -brief -color'
which propogates the options to everything. Then if you need the full output, just call ip without the alias: $ \ip a
$ \ip l