Live data from Hacker News

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

utcc.utoronto.ca

151–160 of 270 posts

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

#151
post #116
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…

I think google is smart enough that you search with "ip command" (maybe plus "linux", it'll get relevant results. It's better that the command you type often is short, (you can certainly alias ifconfig as "ifg" or anything too).

Yes, DDG gets relevant results too: https://ddg.gg/?q="ip+command"

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

#152
post #69

So, to summarize, ifconfig has to be replaced because it relies on the /proc filesystem and it doesn't handle aliases? This is easily disproven: ifconfig on FreeBSD doesn't rely on /proc and handles aliases just fine. It sounds a bit like the whole OSS/ALSA discussion – some argued that ALSA was needed to replace OSS because OSS didn't support muxing multiple simultaneous audio streams, but strangely OSS on FreeBSD d…

BSD's ifconfig isn't really related to Linux's ifconfig anymore because BSD has continued development and the Linux fork or version (don't remember which it is anymore) hasn't. Linux's ifconfig is a part of net-tools ( http://net-tools.sourceforge.net/ ) and the latest release of net-tools, v1.6, was released in April 2001. It's been unmaintained for over 17 years. Some distros began deprecating ifconfig when the Lin…

> BSD's ifconfig isn't really related to Linux's ifconfig anymore because BSD has continued development and the Linux fork or version (don't remember which it is anymore) hasn't.

There's a simple solution to the lack of maintenance on ifconfig: Maintain ifconfig.

There's no need to break shit.

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

#153

Earlier quoted context omitted.

Yup, you could say that again. I cut my teeth in Linux while in high school for the most path. First year of college, I go to the engineering labs to get a job, it's all SunOS/Solaris. It's like driving a car! There were very few commands that were different! Now, Linux is slowly going rouge and changing everything in the supposedly name of "progress" I'm still salty as hell with the systemd rubbish. The problem is t…

You do realize Solaris implemented a service management system (which is also superior to systemd; and was also created prior to systemd's conception), right ? They switched away from legacy SysV init scripts BEFORE systemd existed.

> superior to systemd

SMD was based around XML, which caused a lot of boaking.

systemd was based around .desktop, aka .ini syntax.

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

#154
post #64
post #35

Earlier quoted context omitted.

Yeah that’s what I loved about this article, I finally know what to google.

Future tip: your package manager should be able to find this for you, for example: > $ which ip > /sbin/ip > $ dpkg -S /sbin/ip > iproute2: /sbin/ip

You may also want 'whereis' instead of 'which'.

I use cope to colorize my output, which makes 'which' useless to me for most common commands, but 'whereis' still works.

Edit for examples:

    $ which ip
    /usr/share/perl5/vendor_perl/auto/share/dist/Cope/ip
    $ whereis ip
    ip: /usr/bin/ip /usr/share/perl5/vendor_perl/auto/share/dist/Cope/ip /usr/share/man/man7/ip.7.gz /usr/share/man/man8/ip.8.gz

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

#155
post #67
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

Thanks! Just aliased that in my .zshrc. The route object doesn't seem to do colouring sadly.

You may want to consider installing cope, which colorizes the output of a number of common commands, including 'ip route'.

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

#156

As I opened this article, I thought "I bet this is going to be related to some Goddamned systemd change". And sure enough, about halfway through: > This interface has an IP alias, set up through systemd's networkd. The amount of pain and headache this init-kitchen-sink-wannabe- thing has caused me day-to-day is incalculable.

Of course, that does not say that this was a systemd change, and reading this very discussion at https://news.ycombinator.com/item?id=17151686 shows that you lose your bet.

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

#157

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.

The Golang flag [0] package uses a single dash for long options.

The flags that a UNIX command uses can sometimes used to carbon-date that command. For example, dd(1) doesn't use a dash at all, uses long args, and uses an equals-sign to connect a flag with its argument (e.g. `dd if=/dev/null`). It's because dd(1) was written in the dawn of UNIX, before a convention was established for flags.

I believe the first step in creating a convention was the introduction of the getopt(3) library, which introduced single dash, single character options (e.g. `tar -x`). Commands that only have short options tend to be old commands.

Later, GNU introduced getopt_long(3), which allowed for long options and double-dashes to distinguish them from the short ones. This made commands more readable.

There have also been cases where the `-` is optional. `tar xvf` for example. And with the `ps` command, the `-` is used to distinguish BSD flags from System V flags (e.g. `ps auxwww` vs. `ps -elf`).

There has also been a movement for subcommands rather than options (which bring to mind the Cisco CLI), of which `ip` is an excellent example: `ip route show`. But subcommands are not a substitute for options; sometimes you need both (e.g. `ip -6 route show`).

All this goes to show that, although long options are quite common, they are not only game in town, and UNIX commands have a rich and varied set of conventions.

[0] https://golang.org/pkg/flag/

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

#158
the argument that applications using standard files must be update to another api is BS.

the kernel should just map the faster api on those standard file descriptions instead... but then, the "old" files were not part of a standard to begin with... but then again, the standard, whatever it is, was never designed but agreed upon after being in use by enough people.

I have no idea what to make of this. I guess I am just happy that people are moving things forward, whatever the direction.

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

#159
post #45

Earlier quoted context omitted.

What's the best way to learn these things?

LWN ( https://lwn.net/Kernel/Index/#Networking ), LWN + kernel documentation ( https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin... ) , more LWN + iproute2 source/news/commitlog ( https://git.kernel.org/pub/scm/network/iproute2/iproute2.git... and https://git.kernel.org/pub/scm/network/iproute2/iproute2.git... https://www.netdevconf.org/ ) ... and trying them (the features) out. In VMs and in other network…

I'm sure you mean well, but this comment epitomizes the problem. Formerly, Unix was fairly modular, open to comprehension, and had excellent documentation guiding the user. Now, everyone who isn't a paying Red Hat support customer is not just on their own but thrown to the wolves.

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

#160

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…

I have embraced systemctl, and it's intuitive to me, but I feel the way you do about journalctl.

If I want to tail the log of a service, though, there's a mnemonic for that: 'journalctl -fu httpd' - that one sure is easy to remember!

Post reply on HN