Want to use Linux commands, but don’t want to leave Windows? Here are a few ways to run the Linux bash command on Windows.

If you are learning shell scripting in the course, you will need to use Linux commands to practice commands and scripts.

Your school lab may have Linux installed, but you don’t have a Linux laptop yourself, you have a Windows computer like everyone else. Your job requires running Linux commands, and you may be wondering how to run Bash commands and scripts on Windows.

You can install Windows and Linux in dual boot mode at the same time. This method lets you choose Linux or Windows when booting your computer. However, the hassle of using separate partitions to run Linux commands may not be for everyone.

You can also use an online Linux terminal, but your job cannot be saved.

The good news is that there are several ways to run Linux commands in Windows, just like any other regular application. Isn’t that cool?

Use Linux commands on Windows

As an avid Linux user and promoter, I’d like to see more and more people using “real” Linux, but I know that sometimes that’s not a priority. If you just want to practice Linux to pass the exam, you can run the Bash command on Windows using one of these methods.

1. Use Linux Bash Shell on Windows 10

Did you know you can run Linux distributions in Windows 10? The Linux Subsystem for Windows (WSL) lets you run Linux on Windows. Upcoming WSL releases will use the true Linux kernel inside Windows.

Also known as Bash on Windows, this WSL runs as a regular Windows application and provides a Linux distribution in command line mode. Don’t be afraid of command line mode, because your goal is to run Linux commands. That’s all you need.

You can find some popular Linux distributions like Ubuntu, Kali Linux, openSUSE, and more in the Windows App Store. You just download and install it like any other Windows app. Once installed, you can run all the Linux commands you need.

Please refer to the tutorial: Installing Linux bash Shell on Windows.

2. Run Git Bash on Windows

You probably know what Git is. It is a version control system developed by Linus Torvalds, the creator of Linux.

Git for Windows is a set of tools that allow you to use Git on the command line and in graphical interfaces. One of the tools included with Git for Windows is Git Bash.

Git Bash provides an emulation layer for the Git command line. Git Bash supports many Bash programs besides Git commands, such as SSH, SCP, cat, find, and so on.

In other words, you can use Git Bash to run many common Linux/Bash commands.

You can install Git Bash in Windows by downloading and installing the Git for Windows tool for free from its website.

  • Download Git for Windows

3. Use Cygwin to run Linux commands in Windows

Cygwin is a recommended tool for running Linux commands in Windows. Cygwin was created in 1995 to provide a POSIX-compliant environment that runs natively on Windows. Cygwin is free and open source software maintained by Red Hat employees and many other volunteers.

For two decades, Windows users have used Cygwin to run and practice Linux/Bash commands. More than a decade ago, I even used Cygwin to learn Linux commands.

You can download Cygwin from the official website below. I also recommend you refer to this Cygwin memo to get started.

  • Download the Cygwin

4. Use Linux on VMS

Another approach is to use virtualization software and install Linux in it. This way, you can install the Linux distribution (with a graphical interface) in Windows and run it like a regular Windows application.

This method requires that your system have large memory, at least 4GB, but it is better if you have more than 8GB. The nice thing about this is that you can actually use desktop Linux. If you like the interface, you may decide to switch to Linux at a later date.

Two popular tools for creating virtual machines on Windows are Oracle VirtualBox and VMware Workstation Player. You can use either one. Personally, I prefer VirtualBox.

You can follow this tutorial to learn how to install Linux in VirtualBox.

conclusion

The best way to run Linux commands is to use Linux. These tools allow you to run Linux commands on Windows when you choose not to install Linux. Try them all and see what works for you.


Via: itsfoss.com/run-linux-c…

By Abhishek Prakash (Lujun9972

This article is originally compiled by LCTT and released in Linux China