Shell Game

A lot of us spend a lot of time switching between Windows and Linux. Now that platforms like the Raspberry Pi are popular, that number is probably increasing every day. While I run Linux on nearly everything I own (with the exception of a laptop), my work computers mostly run Windows. The laptop is on Windows, too, because I got tired of trying to get all the fancy rotation sensors and pen features working properly under Linux.

What I hate most about Windows is how hard is it to see what’s going on under the hood. My HP laptop works with a cheap Dell active stylus. Sort of. It is great except around the screen edges where it goes wild. Calibration never works. On Linux, I could drill down to the lowest levels of the OS if I were so inclined. With Windows, it is just tough.

War is Shell

One place where Linux always used to have an advantage over DOS and Windows was the shell. There are lots of variations available under Linux, but bash seems to be the current pick for most people. If you want more power, you can move to some alternatives, but even bash is pretty powerful if you learn how to use it and have the right external programs (if you don’t believe it, check out this web server).

In the old DOS days, some of us went to 4DOS which was nice, but no bash (and apparently morphed into the Windows Take Command Console software. I’ve seen a few people use things like Rexx as a shell under DOS or Windows, but it has always been a small minority.

Windows Power

Microsoft finally addressed the shortcomings of its default command interpreter, first introducing Windows Scripting Host to allow Javascript and VBScript batch files. Eventually, this was supplanted by Monad which later became known as the Windows PowerShell.

In addition to running programs, the PowerShell can use functions and cmdlets (programs made to interact with the shell). While it isn’t compatible with a traditional Linux shell, it has similar powers and many people–especially system administrators–make heavy use of it to automate tasks.

Shell Shock

Two things have recently happened that surprised me. First, Microsoft made bash available (and other Linux executables) for Windows 10 as a native application (you can find the detailed install directions online). The surprise isn’t that this is possible. I’ve used Cygwin and UWIN to have a very full-featured Linux environment under Windows for years (and did the same with MKS under DOS). The surprise was that Microsoft would “cross the streams” and officially support a Linux/Unix tool on Windows. Sure, NT used to have a crippled POSIX subsystem, but it wasn’t practical. This appears to be a genuine attempt to put the shell on Windows (which, again, is only remarkable because it is Microsoft doing it).

The second piece of news that surprised me is that you can now get PowerShell for Linux or OS/X. I’m not sure how many Linux users will rush out for a .NET tool, but it is one more way to make the systems more alike which is nice when you use both.

Decisions, Decisions…

So now you have several options for using Linux and Windows without going crazy switching between the two:

  • Run Linux and put Windows in a virtual machine
  • Run Windows and put Linux in a virtual machine
  • Use bash everywhere (using Cygwin or the Microsoft product)
  • Use PowerShell everywhere

If you just can’t stand to take software from Microsoft, you could check out PASH, which is essentially a rewrite of PowerShell using Mono. I’m not sure how much momentum it will retain now that Microsoft is supporting something so similar.

If you do want to learn more about PowerShell, the Wikipedia article on it has a nice table that relates PowerShell to cmd.exe to Linux shell. There’s also a video, you can watch below.

Thanks to [rogeorge] for the tip about PowerShell.

56 thoughts on “Shell Game

    1. I’ve yet to find anyone/company who doesn’t occasionally push out a bug. I find the fact that they will push out a fix a week later somewhat comforting. Many softwares I use would take months to push out a similar patch. This isn’t the ’90s anymore. These types of issues from Microsoft are actually quite rare these days.

      1. The difference being with most other software you can use the old version until a version without the trouble is available, but with Windows 10 they force the updates and you have no choice.

          1. Laptop came with Windows 10. Linux does not properly support all hardware in the laptop yet.
            Windows 10 home, no option to disable updates.

            So… what choice is there? (For the average user)

          2. The choice was not to buy a laptop that linux doesn’t fully support yet. Might not be what you wanted to hear but it’s the truth. Linux support on laptops has exploded but if you’re buying the newest and greatest then you might be waiting awhile for any particular feature to work.

            If manufacturers cared they’d help source drivers for the linux kernel, and some do.

          3. “If manufacturers cared they’d help source drivers for the linux kernel, and some do.”

            If the linux devs cared, they’d provide a standard driver interface with long term support to allow binary blobs instead of holding drivers as hostage to force device manufacturers to open source.

          4. It isn’t that simple. And I don’t think “open source” politics are involved.

            A standard driver interface leaves you stuck with the design decisions you make then, and, well, people make dumb design decisions quite often. Especially in the last 10 years, Linux’s internals have been changing pretty rapidly. Open sourcing a driver doesn’t make it magically work with Linux – someone still needs to maintain it. A binary blob works perfectly fine, it just needs to be maintained pretty actively, which isn’t always practical.

            I think if anything, Linux developers would just prefer if the hardware was *documented* – I don’t think wanting the driver to be open source even really plays into it. If the hardware’s documented, someone else will write a driver for it.

          5. “if the linux devs cared”

            I see how caring works out in the corporate world.
            2 year *flagship* smartphones (samsung note 3 for one)
            do not get software update (android 7.0), because of the lack of drivers!

            Or look all the raspberry-wannabe products, itsupports some old kernel version, unable to run ie. newest docker on it.

            In a money-hungry world your voice is heard through your purchase decision. Sobuy products which are truely supported and not some “promise”.

          6. Yah, it sucks when you want to run brand new from the store hardware and there is no Linux support yet. It usually gets supported eventually though. On the other side of it… I think hardware vendors have been getting even worse at supporting old hardware on new versions of Windows.

            For example, my parents have a garage full of old Dell Printers. They keep buying new computers every few years and the computer comes with a new version of Windows. Predictably they then find that there is no driver that is compatible with the new Windows and the old printer. So they buy more printers too and the pile grows.

            One would think they would learn and try buying from somewhere else. I think they have gotten used to a certain degree of handholding from Dell though and just carry on.

  1. I never used PowerShell on Windows. Traditional command prompt is enough for things I do. But I recently started to use bash over SSH to play with RPi. And even though I don’t really like the way Linux is designed (especially the GUI that still requires use of terminal to do anything), I’m starting to like the amount of control it gives me. But why, for the love of code, all the tool and command names seem to be sounds made by alpaca run over with road roller? Did the designers use some kind of list, like “101 funny noises you can do with our body” to get the names?

    And you should never cross streams, even Ghostbusters knew that…

    1. I’m not sure, but I think I remember reading in ‘The Unix-Hater’s Handbook’ (the book in which was included an airline ‘barf bag’ where a CD is usually placed) the statement “I don’t like any computer language whose commands sound like digestive noises”, or some such. Read the book.

    2. The commands had funny names because back when Unix was created, most users accessed systems via slow interfaces – dialup was typically 110 baud, 300 if you were really lucky – it was quicker to type in 2 or 3 letters than something longer.

      1. The problem of customization is that it only applies to your single computer, and even there you have to keep re-doing it over and over as you upgrade the OS eventually.

        That’s the fallacy of choice. After a while all the choices you have to make just become chores that you don’t want to do. Just give me a set of sane defaults and it’s easier to adapt that fight the windmills.

        1. Don’t think like that, that makes me a bit sad

          I’ve had the very same Linux setup for four years now. I was a windows user before. Since then I have changed my kernel, display manager, window manager, terminal emulator, customized my shell, theme, desktop notifications…
          I rarely visit my dot files, and when I do it is to add something I’d like to have. I have only had to update them because of deprecated options or issues that were work-disrupting a few times. My dot files are stored in bitbucket and I could restore part of my configuration in other machines when I needed to.

          I don’t say it is perfect, you need to be really organized. There are quite a few settings I’d like to change and the config doesn’t let me. I am not going to say ‘I can go to the code and change it’, because I can, but I’d then need to spend time doing so and merge my changes on every update. I don’t think that is the way it is meant to be done (unless you want to issue a pull-request for your changes), but there are choices, lots of them. While in Windows/Mac you just learn to live with the whole system, in Linux you can find the best setup for you and deal with the few rough edges that you find.

    3. Compared to not actually be able to much at all with Windows in the GUI or power shell except run programs and query other systems. Also Linux does not have a default GUI so use one that does have the capabilities you need.

      If you still cannot find a GUI feature that you need then you can make it yourself and you don’t need to buy a 3rd party application like you do with Wondows (but you might find one that someone else has made and most likely it will be free)

      If a program fails to start in Windows then you are dead in the water (with or without powershell). If the same happens in Linux then there are lots of tools that will help you determine the cause of the issue.

      So with Linux you have to learn some unusual names? Only if you want to, because you can search for the name of a program (by its capabilities, not just its name) that does what you want it to do.

      Windows is an operating system that is designed for non technical people (think Fisher-Price), and Linux is scalable all the way up to the top 500 Super computers in the world.

      1. 1. I basically use operating system to run programs that actually do what I need them to do. And both Windows and Linux are good at that. Actually it would be hard to make an operating system that can’t run any programs.
        testing every GUI to find, which has the menu or window for configuring something is even bigger waste of time and effort than actually locating proper config file and editing it. And because most Linux developers don’t give a flying duck about ease of use and user experience, it won’t change anytime soon. But at least some people are working on it.

        2. Some specialistic software I use from time to time is Windows-centric only. Some of it works the same on every version of Windows without special needs. This software is rarely adapted for Linux because there are so many versions of it, and sometimes they are incompatible with each other. And no company who spent over 10-30 years developing their software will release the sources so I could compile it for my Linux. And things like Wine sometimes are not an option. There are open source alternatives, but they sometimes lack in functionality or stability. Still I use as many open source program as possible, because I’m cheap, and I don’t really have money for every piece of software I’d love to use. Sometimes I’m stuck with poor alternatives. And sometimes these alternatives are not as poor as I expected.

        3. If program fails to start on Windows, it probably has a good reason. Good software will at least report the problem in form of error message and/or log file. And in most cases the program just needs a .dll library put in \Windows\System32\. I imagine the same can happen in Linux when some piece of software breaks dependencies.

        4. Not only names. Tools themselves are a bit odd too. And the whole idea of chaining commands and piping output from one to another to do something is confusing at best and infuriating at worst. if there is demand for such a chain to do specific thing, there should be a program named after sound made by regurgitating cow. Also that part about funny names wasn’t meant to be taken so seriously.

        5. Most of computer users are non-technical people. That’s why they use Windows. And that’s also the reason there is limited support for Linux. If someone made a Linux that just works out of the box and gives user experience of Windows without the need to learn awkward commands and hand-rafting config files, it would be widely adopted and supported. Ubuntu was a good start and there are others that are making effort. One thing that will help them will be Vulcan. I’d love to have a working and well-supported by third-party developers alternative to Windows before they switch to “OS as service” model (it will be their end)…

        1. 1, “Testing every GUI to find blah blah” – Have you heard of google?

          2, WINE has improved greatly – have you tried it recently to run your program

          3, “Good software will at least report the problem in form of error message and/or log file” – Windows fails to do that for its own components and what about when you are trying to get something new working?

          4, Chaining commands together is the real strength of *Nix – you can make it do just about anything by combining small components that do something simple very well, to make something far more complex – just like Lego.

          5, Everyone does not use Windows – there are also MAC users out there and a whole load of Linux users too (lets not forget Android). My son has used Linux since he was 5, so if he can do it…. Also where did you get the idea that there is only limited support for Linux? Redhat Linux Support even support Windows as well as being superb at Linux support and once again I ask, have you ever used google?

        2. > Most of computer users are non-technical people.

          > If someone made a Linux that just works out of the box…

          Out of the box for your non-technical average computer user means it comes installed on the machine. Yes, there are companies that sell computers this way.

          But.. since most are coming from Windows and have existing hardware… I’ve installed pretty much every version of Windows since 3.11 on many many machines. I have also installed several distributions of Linux. I can honestly say that modern, user-oriented distros like Ubuntu for example are generally much easier to install than Windows provided that you are installing solely on well supported hardware.

          So.. no, I wouldn’t go promising grandma over the phone that Linux will install easy on some computer she happens to have that came with Windows on it before I even look at the thing. But then… I wouldn’t make that promise about installing Windows on a computer that didn’t come with it or even that came with a different version of Windows.

          Does anybody else remember the Tetris game that was built into the Caldera installer way back when? I miss that. It beats the hell out of those stupid slide shows that Linux and Windows installers alike want to shove in your face. I’m already doing the install… stop trying to sell the product to me FCOL!

          >…and gives user experience of Windows without the need to learn awkward commands and hand-rafting config files…

          What does a ‘non-technical’ computer user do in Linux, Windows or any other OS that requires commands and config files?!?! I’ll grant you this if someone is trying to push Gentoo on your unsuspecting non-techie. What’s a computer to most people these days besides a web browser anyway? Maybe a student has to write papers. Libre Office is just as easy to click-start in most Linux desktop managers as MSOffice is on Windows.

          As a technical person myself however… Maybe if Microsoft ever makes a version of Windows that can give me the user experience of Linux without having to navigate a big jumbled pile of unorganized registry entries, half of which are encrypted and more than half of which come from programs that were already supposedly uninstalled then maybe I can adopt it myself.

    1. Well, if you like or are interested in PowerShell at all, use Hyper-V. It does require that you are running Win 10 Pro, but it sure is nice to be able to manage via PowerShell.

      1. I have used KVM/QEMU, Hyper-V, and Vbox…whichever you run on Linux runs using less resources under Linux. Windows versions (unfortunately) just stack a lot on top of a lot.

  2. From my perspective it’s against hacker creed – “because I can” as with Windows I can’t. Don’t take me wrong, I use Windows – as playing SC2 on Wine needs too much gymnastics after any update, in no way I feel I’m a good Linux user too – as I’m your average Ubuntu.
    On the other hand I have to use Windows in work, just because it’s corp. It’s painful to see how anty virus eats half of my resources, no customisation, I can’t even have all the features and commands which are normal on my distro.

    Lastly, each time I read some manuals, books, etc. I’m greatly impressed by all the work that man after man did and shared with others. For free hacker for hacker, that’s something I would love to read about from time to time.

  3. all these windows comments are bs.

    windows is dead. you cannot bring it back to life by transplating a brain.

    “windows is good for blah, blah, blah”. no its not. this is 2016. the reality is that there is nothing useful or unique or pleasurable about windows. let alone justifying the price tag. windows is going the way of palmOS. YES it will still have its stalwarts but NO they will not be developing software on it for very long.

    hackaday, cover useful tools please.

    1. Video games are no longer enjoyable? I have a multitude of games that I enjoy that simply do not have Linux or Mac compatible versions. Believe me, if they did I would not use windows.

    2. Adobe Premiere Pro. Actually, the Adobe Creative Suite. Show me a linux equivalent – where the footage editor seamlessly exports to the SPFX editor, then takes back the SPFX footage, then exports the audio track/s to the audio editor, then takes back the corrected/adjusted audio, then exports the whole film to the colour grader and returns it, then exports the completed film to the authoring suite. It’ll even export to DCP (Digital Cinema Package). I could go on. FWIW, Deadpool was edited in Premiere Pro – maybe it was done on Macs rather than Windows, I don’t know, but it wasn’t done with FOSS tools. If I were to edit a feature film, I’d use Creative Suite on Win 7 (that’s what I’ve got right now, but I’ve only edited shorts and musicals). Macs don’t have the performance to edit high-def footage.

      I’ve tried the linux alternatives (Ubuntu Studio, Fedora Media), with….. limited success. Spent more time trying to get various packages to a stable state after they kept crashing, than I spent editing. I gave up.

      I’d really like to see Adobe produce a GNU/Linux optimised version of Creative Suite, but I don’t think it’s going to happen.

      1. Syn* DC*, Syn* ICC* in fact all the tools from Syn* and Cad* for VLSI industry and from many other companies; show me a windows version. Not talking about optimized, just show me it exist. (Not that I hate windowz, I use it regularly)

        * all the copyright and trademark names, I’ve omitted.

  4. I haven’t used Window$ in the last decade, but I don’t mind if other people do, unless they want to store my private data on their easily owned systems. I’m talk’n at you Mr. Gubberment!

    1. Actually, I think that this is more of a new strategy: EMM (Embrace, Meld, Morph-into). I kinda predicted this back around 2000-ish. There used to be a joke webpage pushing MS Linux. *nix OS has what Windows needs: stability, security, customizability, wide spread adoption, so much back catalog of tools, software, and docs it’d make your eyeballs explode. Now that MS has pulled as much money out of Windows as it easily can, it’s time to transition to products that are easier to milk, like services. Services are pretty much honey badger about OS.

  5. Great coincidence, just recently I’ve been looking at various console replacements (conemu, babun, cmder, PowerCmd , Console2 , ConsoleZ, etc, etc).. anyone have a favorite?

    I use MobaXterm for all ssh thing related, but would love to also be able to use bash and the regular command line window all within the same gui. (I currently have to switch to a cygwin terminal to do anything bash, and a regular cmd window to do simple .bat files)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s