4 ms·
TIL: iproute2 has a color, a brief/human mode, and a one-line mode. I think I am going to be aliasing ip -color to ip from now on. $ ip -br -c a # ip -brief -c
by iod 8y ago
TIL: iproute2 has a color, a brief/human mode, and a one-line mode. I think I am going to be aliasing ip -color to ip from now on.
$ ip -br -c a # ip -brief -color address
lo UNKNOWN 127.0.0.1/8 ::1/128
eth0 DOWN
wlan0 UP 192.0.2.1/24 2001:db8::1/64 fe80::1/64
$ ip -br -c l # ip -brief -color link
lo UNKNOWN 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
eth0 DOWN 00:12:34:56:78:9a <NO-CARRIER,BROADCAST,MULTICAST,UP>
wlan0 UP 12:34:56:78:9a:bc <BROADCAST,MULTICAST,UP,LOWER_UP>
- berti 8y agoThanks! Just aliased that in my .zshrc. The route object doesn't seem to do colouring sadly.
- amyjess 8y agoYou may want to consider installing cope, which colorizes the output of a number of common commands, including 'ip route'.
- agumonkey 8y agoTLDRRTFM of the day
- majewsky 8y ago"read read"?
- dak1 8y agoThis is a good reminder that defaults should be simple and human readable. Advanced options should be behind flags for power users, not the other way around.
- piotrkubisa 8y agoIndeed. I don't get it why `ip` has -brief which is not a default behavior and why -verbose flag does not exist. Also there could be a -no-color instead of -color flag.
- digi_owl 8y agoOr simply detect when piped and leave the color out, as just about every sane cli tool does it.
- wyldfire 8y agoAFAICT these options are new(er) and making them the default would likely be a backwards-incompatible change. I can see how it would be an uphill battle to convince the maintainers to introduce what appears to be a breaking change. That said, a new alias that does trigger these new behaviors as defaults would be a sane compromise.
- petre 8y agoJust update ip to emulate ifconfig and netstat when called as such, like busybox does. Or all of those MTAs that ship with a sendmail command.
- linsomniac 8y agoI'm one of those "grumpy old admins" they mention in the post, but I've switched to using ip for 5+ years now and have been happy. But, -brief -color is a new one on me, and I'm gonna add that to my toolbox.
- deleted 8y ago[deleted]
- m3adow 8y agoThe "-brief" switch is not mentioned in the default manpage, at least on my Ubuntu 16.04 installation. Why? This should be mentioned prominently, as it's so useful.
- 8_hours_ago 8y ago"-brief" is also missing from the ip manpage on my 16.04 desktop, however it is listed in the output from "ip help". Looks like someone needs to update the man page...
- zantana 8y ago$ ip -br -c a # ip -brief -color address Option "-br" is unknown, try "ip -help". Friggin' RHEL I guess I'll have to check back in a couple of years.
- apple4ever 8y agoWHOA That's crazy helpful. I'm aliasing it as well. (FYI --color works too)