javascript contador Skip to content

How to use Linux commands in Windows terminal

Microsoft blocks Linux installation on some Windows 10 laptops

Microsoft blocks Linux installation on some Windows 10 laptops

A program will allow you to use Linux commands in Windows as if they were native to the system.

As a regular Linux user, one of the things I miss the most when I have to use Windows is terminal commands.

Although it may seem like a primitive method to use a computer, writing the commands directly to a terminal is often faster and more powerful than using a graphic interface. That doesn’t mean Windows doesn’t have its own command terminal, of course, but in the Microsoft system the graphic interface dominates everything and the terminal is an option, while in Linux it is the opposite.

Cash, the program that brings Linux to Windows

Fortunately, there are projects that have managed to bring some of that potential to Windows, and today we are going to review one of these alternatives, called Cash.

Cash is a Linux terminal emulator, but it has its limitations. For starters, we will not be able to use all the commands available on any Linux distro, but we will use the most used ones, such as ls, mv, tail, cp or cat. In addition, more commands are expected to be added over time. Here is the complete list:

  • alias
  • cat
  • clear
  • CD
  • cp
  • threw out
  • export
  • false
  • grep
  • head
  • kill
  • less
  • ls
  • mkdir
  • mv
  • pwd
  • rm
  • sort
  • source
  • tail
  • touch
  • true
  • unalias

Cmousar Linux commands on Windows

First of all, we have to install Node.js if we don’t have it installed yet. Node.js will allow us to execute Javascript code in our system, and there are more and more projects that take advantage of it, such as Cash. We just have to go to the official page of Node.jse install the appropriate version, x86 or x64.

Download Node.js

Next we just have to open a Windows terminal (start menu and search cmd) and write the following:

npm install cash-global -g

We let it do its work, and when it finishes we will have Cash installed.

To use Cash we just have to open a terminal and execute the cash command. Since then we can use any of the previous commands. For example, if we want a list of the directories, we can use the ls command; Of course, we can also use the options of those commands, like ls -la to get a more detailed listing.

A very good detail is thatwe can use Windows commands together with Linux ones, and we can chain them together; for example, we can run the following command ipconfig | grep IPv4 | sort, and it will show us only a list of the IPv4 connections that we have in the system, instead of all the text block that the ipconfig command usually presents in Windows.

Of course, Cash is free software and is available on Github.