Live data from Hacker News

There are real reasons for Linux to replace ifconfig, netstat, etc

utcc.utoronto.ca

141–150 of 270 posts

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#141
post #58

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 eth0 DOWN 00:12:34:56:78:9a wlan0 UP 12:34:56:78:9a:bc

The "-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.

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#142

While this article makes a case for the new command, the reality is simple. I personally learned ifconfig continually in my life and so I learned how to read it and interpret what it was trying to say. It output its commands in a fairly easy to parse way. The new command, while I am sure is progressive and forward thinking, feels clunky. I often have to try to remember the name of the command itself as it is not obvi…

I feel like systemctl and journalctl are the same way. They are terrible commands with awful usability. Having a full process control system is nice and helpful when writing a package once for several platforms, but I wish something had caught on that had better usability and didn't try to do everything from login management to filesystem mounting, but rather just process management. Where as someone could probably w…

systemd has decided for you that these commands are better. It is now your responsibility to accept their decisions.

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#143

While this article makes a case for the new command, the reality is simple. I personally learned ifconfig continually in my life and so I learned how to read it and interpret what it was trying to say. It output its commands in a fairly easy to parse way. The new command, while I am sure is progressive and forward thinking, feels clunky. I often have to try to remember the name of the command itself as it is not obvi…

I feel like systemctl and journalctl are the same way. They are terrible commands with awful usability. Having a full process control system is nice and helpful when writing a package once for several platforms, but I wish something had caught on that had better usability and didn't try to do everything from login management to filesystem mounting, but rather just process management. Where as someone could probably w…

Are they really "terrible" with "awful usability"? In my day-to-day debugging, I do find `journalctl` much better. Let's see a couple of quick examples:

- Show logs for the current boot: $ journalctl -b

- To get all errors that are of priority level ERROR and worse: $ journalctl -b -p err

- Show me logs for a given binary: $ journalctl /usr/sbin/libvirtd

- Or via its unit file: $ journalctl -u libvirtd -l

- Want to query all the errors for a given disk? Here we go: $ journalctl /dev/sda -p err

And so on...

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#144
post #21
post #18

I'm trying hard to fight my old muscle memory to use ip instead of ifconfig on Linux. I have a few issues though: * "ip" is useless as a keyword if you're looking for help online. It's extremely frustrating and probably my main issue actually learning how to use the damn thing. * ifconfig's output is simply more readable IMO: https://svkt.org/~simias/up/20180525-113825_ip-vs-ifconfig.p... . It's pretty weird that a b…

Exactly. Even the `ip` name is misleading as the command does much more than only ip-related things (link layer, network namespaces, tcp, …).

Always wondered about this - is IP 'internet protocol' or something else, since it's much lower level than IP? I've been using IP route 15 for 15, maybe 20 years now and hinestly have no idea.

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#145
post #120
post #113

Earlier quoted context omitted.

Not Invented Here ( https://en.wikipedia.org/wiki/Not_invented_here )

Better to avoid vague grammars when not everyone is a native English speaker.

Pretty discoverable/common: https://www.urbandictionary.com/define.php?term=NIH

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#146
post #88
post #32

Earlier quoted context omitted.

to get the gateway: ip route show default > > ifconfig's output is simply more readable IMO I prefer iproute2's terseness.

When asking "what's the default gateway?", more often than not, the real question you have is "what's the gateway to IP address X", which would be: ip route get X

No it's not, it's usually "What is the default gateway on this network segment because I want to plug my laptop in"

I do use ip route a fair bit - if I have a machine connected to two (or more) network segments and want to ensure traffic gets routed back the way it came

However my main criticism for "ip route" is that it's inconsistent and a change route "route"

"route" does reverse dns lookups - e.g "my.server.tld rather than "1.2.3.4", or "default" rather than "0.0.0.0"

"route -n" shows 1.2.3.4

"ip route" doesn't do reverse lookup, however it does say "default" rather than "0.0.0.0".

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#147

Earlier quoted context omitted.

I have used ip -oneline to parse configuration of servers, and it's really practical. The only real gripe I have with IP is their long argument/switch format. Unlike everyone else, ip is a minority, which accepts long options with single dash "-". This prevents someone from combining many short parameters under a single dash, also it's confusing to use. Yes, it unofficially supports the old double dash format, but if…

This is ridiculous. I would love to know their justification for using single dash for long options. When did that become the "old way"?? Very old X11 commands and many Solaris commands use a single dash, but nearly all modern commands use double dash. And I agree that this syntax makes it hard to combine single-character options. They must have had a very compelling reason to use a non-standard option syntax.

openssl uses single dash for long options too: -inform, -outform, -text, -noout, etc.

gcc uses single dash for long options too: -std, -pedantic, -dumpspecs, etc.

I am sure there are many more modern commands that do this.

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#148
post #57

M. Siebenmann's actual main point, ignored by much of the "I do/do not like ip/ifconfig." discussion here, is that it is valid to replace ifconfig because the standard output of the command is an interface contract that is set in stone because of people using it in scripts. I disagree, on two grounds. Firstly, the ifconfig commands in the BSDs are existence proofs that this is not so. The BSD people actually have mod…

(It took me a sec to realize you were using the verb "founder".)

Excellent point.

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#149
post #18

I'm trying hard to fight my old muscle memory to use ip instead of ifconfig on Linux. I have a few issues though: * "ip" is useless as a keyword if you're looking for help online. It's extremely frustrating and probably my main issue actually learning how to use the damn thing. * ifconfig's output is simply more readable IMO: https://svkt.org/~simias/up/20180525-113825_ip-vs-ifconfig.p... . It's pretty weird that a b…

The man page is good. `ip` takes a --oneline arg to make it more parseable.

A --json arg would be much more parseable. I wonder if they'd be against that?

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#150

Earlier quoted context omitted.

> "ip" is useless as a keyword Most docs will mention iproute2. You can use that for googling.

On my CentOS 7 system, there is no iproute2 package, but there is an iproute package. Neither 'man iproute' nor 'man iproute2' produce any man pages. The iproute package provides the contents of /etc/iproute2, among other things, so why is the package name just iproute? The man page for ip has the name iproute2 at the very bottom, where it is easily missed. It would never have occurred to me to look for either iprout…

What you're describing seems like an inexcusable state of affairs, but as a practical matter `man -k ` or `apropos ` is useful for finding poorly named manpages.

Of course in the specific case of "ip", both are going to return quite a haystack to search through...

Post reply on HN