Re: BUG or OPERATOR error? - was [Re: Measuring aggregate internet useage?]
- To: debian-user@lists.debian.org
- Subject: Re: BUG or OPERATOR error? - was [Re: Measuring aggregate internet useage?]
- From: David Wright <deblis@lionunicorn.co.uk>
- Date: Mon, 1 May 2017 13:18:58 -0500
- Message-id: <[🔎] 20170501181858.GB14026@alum>
- Reply-to: debian-user@lists.debian.org
- In-reply-to: <20170426125015.sl3o7fnkggswtqr3@darac.org.uk>
- References: <bac079b4-2c94-3584-b333-9c3a61e3062e@cloud85.net> <slrnofrh50.ohg.dan@xps-linux.djph.net> <a75961ec-d13e-8f99-f3d7-d919c2dda98d@cloud85.net> <63374e90-1950-2f46-2193-4fd2961d5d42@transient.nz> <2b6fda90-c6e4-a96b-eeb1-f9d6a677da3e@cloud85.net> <9ff992a4-c317-15f6-ba02-c454a298afdc@cloud85.net> <20170426122518.54fvsiftpv3cvvij@darac.org.uk> <20170426123544.GH20910@eeg.ccf.org> <20170426125015.sl3o7fnkggswtqr3@darac.org.uk>
On Wed 26 Apr 2017 at 13:50:15 (+0100), Darac Marjal wrote:
> On Wed, Apr 26, 2017 at 08:35:44AM -0400, Greg Wooledge wrote:
> >On Wed, Apr 26, 2017 at 01:25:18PM +0100, Darac Marjal wrote:
> >>For interface statistics from ip, try "ip -s link [interface]".
> >
> >On stretch:
> >
> >wooledg:~$ ip -s link eth0
> >Command "eth0" is unknown, try "ip link help".
> >
> >wooledg:~$ ip -s link dev eth0
> >Command "dev" is unknown, try "ip link help".
> >
> >wooledg:~$ ip link help
> >[... enormous BNF dump, entirely missing -s, or any reference whatsoever
> > to the fact that you can stick options between "ip" and "link" ...]
Presumably you realisd that the options to ip are documented in
man ip and summarised in ip help. Otherwise, this has to be
duplicated and maintained seventeen times.
> >wooledg:~$ ip -s link show eth0
> >2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
> > link/ether a0:8c:fd:c3:89:e0 brd ff:ff:ff:ff:ff:ff
> > RX: bytes packets errors dropped overrun mcast
> > 380719013 1442490 0 0 0 4731
> > TX: bytes packets errors dropped carrier collsns
> > 57971257 614586 0 0 0 0
> >
> >Aha!
>
> My bad. I actually only got as far as discovering "ip -s link" on my own
> system. As I was typing up the email I remembered that Richard was after
> statistics for a specific interface. I should have been more diligent in
> working out the correct format.
>
> >
> >(Sadly, this is my *typical* experience with the ip command -- trying
> >random things until one of them works, because the documentation
> >is impenetrable, and the syntax barely guessable, and certainly not
> >predictable.)
>
> ip *could* do a lot better, it's true. As a monolithic tool, there's not
> really much excuse for the different sub-tools to parse the commands
> differently. As you say, "ip address" expects the device to be expressed
> as "dev eth0", so why doesn't "ip link" handle it the same way? I don't
> know.
They do. Both expect a command. You can "show" something but you can't
"dev" it or, at least, I don't know how to.
Cheers,
David.
Reply to: