Pinterest Stumbleupon Whatsapp
Ads by Google

Linux and Windows are two starkly different operating systems, and nowhere is that more apparent than with the command line.

Windows’s command prompt is a clunky mess that feels more like an afterthought, than an integral part of the OS. Linux’s is elegant and well-designed, and makes it easy for users to be productive.

It should come as no surprise that there are various tools tools designed to make Windows feel a bit more Linux-like in this regard. One of the most promising is Cash (a recursive acronym for “The Cash Shell”).

The Cash Shell In A Nutshell

The Cash Shell aims to create a lightweight, Linux-like shell for Windows. It’s doing that be faithfully re-implementing existing Linux utilities using the latest generation of JavaScript, called EcmaScript 6.

The overarching philosophy of the project is that you should be able to run “ls -l”, or use Grep to search for something, and it should work on Windows as it would on Linux.

Although it’s only early days, it already contains a number of core Linux utilities, including cat, clear, echo, export, false, grep, less, mkdir, and more. Although it’s nowhere near comprehensive, it has enough to allow you to be productive.

Ads by Google

AvailableCommands

Cash is a newcomer in a field that’s increasingly crowded. From the get-go, it’s competing against the likes of Cygwin, Shell.js, and Cooperative Linux. But Cash has a card up its sleeve, that gives it a distinct advantage over the competition.

Take Cygwin and Cooperative Linux, for example. To install Cygwin, you must also install a number of bulky DLLs. Cooperative Linux is worse, as you’re literally running a pared-down version of Linux simultaneously. But CASH is lightweight. It measures in mere megabytes, and has only one dependency, which is node.js.

It’s simply a faster, more streamlined product.

Installing CASH

So, if you’re convinced, here’s how you can install Cash. It’s easier than you might think. First, you have to go to the Node.JS website, and install the latest version for Windows.

InstallNode

This, in addition to containing the Node.JS interpreter What is Node.JS and Why Should I Care? [Web Development] What is Node.JS and Why Should I Care? [Web Development] JavaScript is a just a client-side programming language that runs in the browser, right? Not any more. Node.js is a way of running JavaScript on the server; but it's so much more as well. If... Read More (which runs the JavaScript code), also contains the Node Package Manager (NPM). This is a little bit like apt-get, and allows you to download other people’s code. To install Cash, just run the following command.

npm install cash -g

InstallingCash

It’s worth pointing out that the Cash developers have plans to release it as an easy-to-install MSI file. By the time you read this article, that might have already happened. To find out, check the official Github page.

If Cash installs without any error messages, it’s ready to be used. Type cash to switch into the Cash shell, and read on for a taste of what it can do.

Mixing Linux and Windows Commands

One of the most amazing things Cash can do is natively mix Linux and Windows commands. Let’s imagine you want to list all the USB drivers installed on your machine.

You could do that by running the driverquery command (one of many useful Windows commands 15 CMD Commands Every Windows User Should Know 15 CMD Commands Every Windows User Should Know The command prompt is an antiquated tool from an era of text-based input. But some commands remain useful and Windows 8 even added new features. Find out which ones. Read More ), and piping it to Grep. While you’re at it, you could also sort it using, you guessed it, the Linux sort command. Here’s how that would look:

driverquery | grep USB | sort
CASHmixingWindowsCommands

Not Just An Alias

You could be forgiven for thinking that many of the commands in Cash are actually Windows commands that are masquerading as Linux commands. That if you dig a little bit deeper, perhaps throw in a few obscure arguments, things would begin to unravel. But that’s not the case.

Just check out the help page for ls. It’s exactly as you should expect.

CASHLS

Likewise, Cash’s implementation of Grep is 100% POSIX compatible, as demonstrated below. It’s remarkable, when you consider each utility is essentially being written from scratch in JavaScript.

GrepPosix

Unix Style Permissions

Another cool thing I like about Cash: It brings UNIX style permissions to Windows. Just run ls -l, and you’ll see each file listed with its permissions written in traditional UNIX symbolic notation.

listingDocuments

Sadly, the chown command hasn’t been ported yet, so you can’t change file and folder permissions as you would in Linux. This will arrive in a future version of Cash.

Install Components As You Need Them

One of the overarching themes of Cash is that everything should be light, and efficient. As a result, it should come as no surprise that you can install Linux commands on a piecemeal basis. Only need ls? Just run:

npm install cash-ls -g

Just adjust the above command for the utility you’re trying to install.

Deal With Text Files As You Would On Linux

If you have to deal with large text files, such as the ones produced as log files by utilities like Logcat How to Get a Logcat for Reporting Bugs on Android How to Get a Logcat for Reporting Bugs on Android If you've ever been asked for a logcat, this is how to do it! Read More , you’re probably best off using Linux. It’s just a fact. Linux has a veritable smorgasbord of text-wrangling tools, many of which have found their way to Windows, thanks to Cash.

We’ve already talked about Grep and Sort. Cash also has Tail, Head, Less and Cat.

head

Of course, there are a few other additions which would be nice to have. Right now, if you want to use the Vim text editor The Top 7 Reasons To Give The Vim Text Editor A Chance The Top 7 Reasons To Give The Vim Text Editor A Chance For years, I've tried one text editor after another. You name it, I tried it. I used each and every one of these editors for over two months as my primary day-to-day editor. Somehow, I... Read More from within a terminal on Windows, you have to use Cygwin. Likewise, there’s no Sed or Awk Every Linux Geek Needs To Know Sed and Awk. Here's Why... Every Linux Geek Needs To Know Sed and Awk. Here's Why... Two of the most criminally under-appreciated Linux utilities are the admittedly arcane Sed and Awk. But what are they? How are they used? And how do they make it easier to process text? Read More .

Fortunately, these are all pretty high up on the CASH roadmap. They’ll show up eventually.

Traversing The Command Line

Perhaps my favorite thing about Cash is that it just lets you deal with stuff like you would on Linux. Directories work like they do on Linux. You can move from folders like you can on Linux. You can “touch” files into existence, before swiftly removing them with an “rm”.

You can also create and remove aliases, and copy and move files and folders as you would on Linux. It’s actually pretty amazing to see.

Will You Install It?

So, here’s the million dollar question: will you install Cash?

Are you tempted by it, or are you going to stick with your Linux virtual machine, or Cygwin? Whatever you decide. Let me know in the comments below.

  1. Anonemousse
    June 24, 2016 at 5:26 pm

    Cmder and babun are the best I've ever used and are the most comprehensive. Cmder can run babun, zsh, git, and probably cash under the hood and you just have one terminal with all the bells and whistles to work from.

  2. Akash
    May 22, 2016 at 10:31 am

    Gr8. Thanks.

  3. JMJ
    March 24, 2016 at 3:02 pm

    Since the dawn of Windows, I've been using programs to be able to use real commands (i.e. unix ones), not just DIR!
    I used a lot "Santa Claus utilities" in DOS 6.2 then, when Windows became 32 bits, I turned to Delorie's tools (http://www.delorie.com/djgpp/). I still use them today...

  4. -rob-
    March 23, 2016 at 2:40 pm

    I've used the mks toolset for a long time. It contains a lot of the Unix/Linux commands and runs directly on Win (no VM or so).

  5. Chuck Jaeger
    March 22, 2016 at 6:50 pm

    I'm starting to use "GitHub for Windows Shell" which is PoshGit, a Windows Power Shell environment for Git.

    Seems to have: ls, grep, perl, sed, awk, vim, less, more, head, tail, find

  6. linux_user
    March 22, 2016 at 8:54 am

    Hey,
    I'm not affiliated with MobaXterm. Just a happy user.
    Not sure why you didn't publish my comment.

  7. Alexandru
    March 22, 2016 at 7:37 am

    The very same Linux tools can be easily ported to Windows given their source is available. The native Windows applications / tools make them more productive. Also, if at some point the standard will be extended and all POSIX tools will be updated (quickly), the extra-effort will be necessary to port them to Node.js.

    Many Linux features that are native in Linux environment (e.g. POSIX permissions) are just out-of-place in Windows.

    You better can use newer GNU tools like MSYS2 which has Arch Linux' package manager Pacman, so you can easily install whatever you want.

  8. Ribbet
    March 20, 2016 at 1:03 am

    OK, I installed it - but I know nothing about Linux - so is there a help file and/or how to I access it? Is there an icon (very new newbie here).

  9. Dani
    March 15, 2016 at 1:36 pm

    tail -f results in "invalid option"

  10. slurped
    March 15, 2016 at 12:04 pm

    I dont have Windows, but i dont see installing and especially executing the overhead of Node on each command that would run perfectly fine if compiled natively. IMHO this whole idea sounds like a fun hobby project but nothing that should be hyped in anyway. There is Gow for example that is not trying to reimplement the wheel and really comes with full performance.

    • slurped
      March 15, 2016 at 12:05 pm

      Also why is it done from scratch? Most of these tools compile perfectly fine to JS.

  11. Bikas
    March 14, 2016 at 10:01 pm

    This is cool, but still misses few Linux commands. My personal favourite is GetGnuWin32 (http://getgnuwin32.sourceforge.net/).

    I don't think I'm missing any Linux command with it at all. Although Cash seems to be streamlined version of it so I may try in future, but not sure if it can surpass the vastness of GetGnuWin32

  12. Michael
    March 14, 2016 at 5:30 pm

    Sounds like something worth exploring once more of the standard tools are available. Awk & sed are ones that I use quite often in my shell scripts.

    It is cool that this is all being done in Javascript. Every feature you've discussed is already available in Cygwin, though, so I don't see a point in switching at this point.

    • Joppez
      August 31, 2016 at 9:07 pm

      Don't hold you breath while they are trying to implement AWK in Javascript. It is of course doable, but it will probably take a lot of effort. Why are they not using the original GNU toolchain and use Emscripten to cross compile them instead?

  13. Michael Rollins
    March 14, 2016 at 5:26 pm

    I just tried this on my Windows 10 desktop. It very much reminds me of the systems I used when I was working in the telecommunication industry,. They were unix based. NEAT !

Leave a Reply

Your email address will not be published. Required fields are marked *