linux vs Windows: ‘everything in linux can be done from the command-line’ -> not really

One thing I like about linux is that it’s very easy to script things from the command-line.

And it really is, I feel.

That said, there is a limitation to this I feel, and that is: all the stuff that’s integrated into Gnome or KDE, rather than implemented at the command-line level and wrapped in a gui.

Here’s a good example of something I think is done well in this respect: ufw, vs gufw.

ufw works just great from the commandline, and if I want I can give the graphical version – gufw – to my girlfriend to use, not that she does, since she doesn’t need to configure the firewall really, but she could. It’s simple, it’s graphical, I feel it’s fine.

Then at the other extreme we have usb key auto-mounting, and networking, which as you can see from my recent posts doesn’t really work by default from the commandline without a fair amount of prodding and pushing. You cannot easily use gnome’s network manager and at the same time control the network from the commandline. They are totally incompatible. Each interface can either be controlled from the commandline, or from Gnome, and not both. I think that this basically sucks!

Another example: disk auto-mounting: Gnome will handle this with some combination of gvfs or gnome-volume-manager. It is possible to create a command-line automounter for usb keys (see previous post), but again, totally incompatible with the gnome ones.

I suppose that what happens is that when someone in the Gnome team writes something, they just naturally integrate it (read: lock it into) Gnome since that will encourage people to use Gnome. Which makes sense I suppose. And it would take more effort to abstract it. But I don’t like it. And suddenly Windows seems to me to be actually quite integrated. Sure in Windows it’s a total PITA to script networking stuff, but it’s possible, and it doesn’t involve disabling all access to networking configuration from the gui!

The ‘mild’ pro-Windows bias in this post may be because I have a windows admin interview on Friday :-P so I have to think about getting myself back into a Windows admin mindset perhaps :-P

4 Responses to “linux vs Windows: ‘everything in linux can be done from the command-line’ -> not really”

  1. Luke Puplett says:

    Good luck with the interview.

    What kind of scripting are you comparing against with regard to Windows?

    Using DOS, built-in tools like PowerCfg.exe, netsh and SDK tools in Windows or do you mean vbScript and PowerShell – or all of them (whatever gets the job done)?

  2. hughperkins says:

    Yeah whatever gets the job done. No particular rules except that the target system is either Windows (for Windows scripts) or some form of Redhat/debian for linux scripts.

    I suppose on reflection that the usb-mounting wasn’t actually a reasonable example to pick, since it can’t really be scripted at all in Windows :-P Or, at least, I feel it is probably non-trivial to customize how a usb key gets mounted when it is inserted, and forget even trying to mount two partitions from a usb key considered as a ‘removable’ device in Windows…

    For the networking, some examples: we want to change a system to dhcp or change it from dhcp to a static address, or change the names of the dns servers. In Windows, changing those things is kind of a pain, you have to go off to the registry I guess, actually not that much of a pain to be honest, but it does need some hunting around.

    In linux, there are two ways to configure a network as far as I can tell, but I’m still just starting this stuff to be honest:
    - there is a text file called /etc/network/interfaces (debian) or /etc/sysconfig/network-scripts/ifcfg-[name of your interface].cfg on Redhat, which you can edit fairly simply. It’s a little like using the registry I guess, about as easy/hard.
    - or… you can use gnome-network-manager, or the redhat equivalent. This is a gui component. The issue is it completely ignores the text files above, not like the Windows gui network controls which actually ulltimately end up reading and modifying the registry values. In fact, in the gnome network manager, if there are network interfaces configured in the text files above, gnome network manager will explicitly avoid configuring them!

  3. Luke Puplett says:

    I see! So its like, but not like, when your wifi card has its own software that inevitably screws other things up and obscures reality, adds another annoying thing to the systray etc.

    P.S. To set an interface to use DHCP := netsh interface ip set address name=”Local Area Connection” source=dhcp

  4. hughperkins says:

    Yes exactly. Well not quite as bad, since Gnome is gnome, it’s not specific to the network card. But yeah, like but not like, as you say :-P

    > P.S. To set an interface to use DHCP := netsh interface ip set address name=”Local Area Connection” source=dhcp

    Ah yes, that does ring a bell now that you mention it. I guess I was thinking of NT :-P

    Edit: hmmm, you know what, it seems like it might be *easier* to script changes to the network card in Windows, eg using netsh. At least, it will work across all recent versions of Windows.

    If for some reason a company was using linux desktops, even the same version of linux, some people might be using /etc/network/interfaces, and some people might be using gnome. And some people might be using kde. Etc…

Leave a Reply