4 ms·
Do not “ip -brief address show” and “ip -brief link show” serve as suitable replacements for most common uses of ifdata(1)? The ip(8) command even supports JSO
by teddyh 5y ago
Do not “ip -brief address show” and “ip -brief link show” serve as suitable replacements for most common uses of ifdata(1)? The ip(8) command even supports JSON output using “-json” instead of “-brief”.
- zwayhowder 5y agoTIL. Thanks. One does have to wonder though, why isn't -brief the default and the current default set to -verbose or -long. I look at -brief on either command and it has all the information I am ever looking for.
- Filligree 5y agoYes, I suppose, but I can never remember those flags.
- hedora 5y agoWell, they're strictly worse for interactive use than ifconfig, from what I can tell from your comment.
- teddyh 5y agoWe were discussing ifdata, not ifconfig. From the documentation, ifdata is explicitly meant for use in scripts. And in scripts, using “ip -brief” or “ip -json … | jq …” may well be suitable replacements for ifdata.
- PaulDavisThe1st 5y agoSure, they do. In fact, I take it back. ifdata(1) is not in any way a replacement for ifconfig(1) for most things. The problem is that just running ifconfig with no arguments showed you everything, which was generally perfect for interactive use. Now to get any information from ip(1) you have to remember an argument name. If you do this a lot, it's almost certainly fine. If you do it occasionally, it's horrible.
- bloopernova 5y agoThose are pretty useful! Although I do wish MacOS had a fully-compatible ip command instead of ifconfig et al.