[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Can we kill net-tools, please?



Andrey Rahmatullin <wrar@debian.org> writes:

> On Thu, Dec 29, 2016 at 11:09:35PM +0000, Wookey wrote:
>> Yeah I think that mess is why I've never felt any need to move away
>> from ifconfig. I ran ip something a few times, went 'huh?' at the cryptic
>> output and stayed with the rather more civilised /sbin/ifconfig.
>> 
>> So it seem that the output does actually label things, but the things
>> and labels look exactly the same. Would some colons really have hurt
>> too much?
>> 
>> i.e. mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 
>> is really
>> mtu: 1500  qdisc: mq  state: UP  mode: DEFAULT  group: default  qlen: 1000 
>> 
>> Anyone think the latter is a tad clearer? I still don't know what a
>> qdisc is or a default group, but it's a lot easier to find things I do
>> recognise. Before this discussion I just saw it as a mysterious jumble
>> of 10 things (after a set of things in CAPITALS that were somewhat
>> mysterious too (what's a LOWER_UP, I wonder) - who knows what it might
>> mean.
>
> Do you really think that
>
> wlp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
>         inet 192.168.**  netmask 255.255.255.0  broadcast 192.168.**
>         inet6 fe80::**  prefixlen 64  scopeid 0x20<link>
>         ether e4:**:ca  txqueuelen 1000  (Ethernet)
>         RX packets 66323088  bytes 90518262611 (84.3 GiB)
>         RX errors 0  dropped 0  overruns 0  frame 0
>         TX packets 18425793  bytes 2920636610 (2.7 GiB)
>         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
>
> is clearer than 
>
> 3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
>     link/ether e4:***:ca brd ff:ff:ff:ff:ff:ff
>     inet 192.168**/24 brd 192.168.** scope global dynamic wlp3s0
>        valid_lft 70216sec preferred_lft 70216sec
>     inet6 fe80:**/64 scope link 
>        valid_lft forever preferred_lft forever
>
> ?

There are two things that make it less clear.

  The thing you are looking for no longer starts at the first column
  
  there are no blank lines between interfaces

If the numbers reach 2 digits then the interface name is indented at the
same level as the rest of the data, which makes it slightly worse.

I suspect that "wasting" a line feed between records would have made a
vast difference to people's ease of adoption.

Try comparing:

  ip addr

to

  ip addr | sed '2,$s/^\b/\n/'

I'm obviously already somewhat used to the normal output, so that now
looks weird, but it is also triggering my pattern recognition from
ifconfig a bit, so seems to have made me feel rather better about ip's
output.

I'm not suggesting we should actually change ip to have blank lines now,
but if you still find ip's output confusing, perhaps trying it with the
sed for a bit will allow you to transfer your familiarity from ifconfig.

If you want an even more old school look without losing any info, try:

  | sed 's/^\(.*\): \(.*:\)/\1-\2/;2,$s/^\b/\n/;s/    /\t/'

Cheers, Phil.
-- 
|)|  Philip Hands  [+44 (0)20 8530 9560]  HANDS.COM Ltd.
|-|  http://www.hands.com/    http://ftp.uk.debian.org/
|(|  Hugo-Klemm-Strasse 34,   21075 Hamburg,    GERMANY

Attachment: signature.asc
Description: PGP signature


Reply to: