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 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.
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.
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.
npm install cash -g
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), 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
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.
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.
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, 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.
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 from within a terminal on Windows, you have to use Cygwin. Likewise, there’s no Sed or Awk.
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.