Black Friday Sale - Up To 40% OFF

How to Run Linux Commands on Windows (WSL, Git Bash & More)

How to Run Linux Commands on Windows (WSL, Git Bash & More)
Published on Nov 24, 2025 Updated on Nov 24, 2025

Running Linux inside Windows was inconceivable a few decades ago. Thankfully, advancements in technology have made this possible. You can now run Linux in Windows or vice versa.

A dual boot is the ideal way of running both systems alongside each other. In this configuration, only one system runs at a time and enjoys the perks of a bare-metal environment. Although convenient, it's not always the magic bullet, and sometimes, boot issues can occur in either operating system for various reasons.

Thankfully, you can skip the stress of having a dual-boot setup and run Linux inside Windows. Let's explore various ways of running Linux commands on a Windows system.

#Run Linux commands using WSL (Windows Subsystem for Linux)

WSL is a handy tool that offers a Linux experience inside a Windows environment. Thanks to its impressive integration with Windows, it brings you as close as possible to running Linux on physical hardware. Its inclusion of the Linux kernel is the real game-changer and what sets it apart from the other tools we shall cover. Offering a full Linux environment essentially ships with all the GNU/Linux tools, providing the flexibility to run an infinite number of tasks.

WSL 2 is the current architecture in the WSL family. It debuted in 2020 and is what you'll get when you publish this review. It does not use virtualization in the traditional sense but runs a lightweight VM that incorporates a real Linux kernel, offering a near-native Linux experience.

Its predecessor, WSL 1, is less performant and plagued with performance issues. It translates Linux system calls to Windows system calls, resulting in filesystem compatibility issues, a major hurdle in most workflows. Its lack of a complete Linux kernel means it does not incorporate an actual Linux environment, resulting in functional limitations.

To install WSL 2, ensure you are running Windows 10 version 2004 and later versions (Build 19041 and higher) or Windows 11. Additionally, be sure that the “Hyper-V” and “Virtual machine platform” features are enabled to create virtual machines. To do this, head to “Turn Windows features on or off” and check the “Hyper-V” and “Virtual machine platform” options to install all the virtualization components. Once installed, restart your system to finish the installation.

When the system powers on, launch Windows PowerShell by clicking the Windows button. Search for "PowerShell", then select "Run as administrator."

launch-windows-powershell

Once launched, run the command:

Command Line
wsl --install

install-wsl-using-windows-powershell

The command installs WSL version 2 and Ubuntu as the default OS. Be patient, as this takes a while. Once the installation is complete, reboot your PC for the changes to take effect. To restart your system from PowerShell, run the command:

Command Line
Restart-Computer

Upon restarting, WSL will continue downloading and installing Ubuntu

wsl-installing-and-downloading-ubuntu-windows

Finally, WSL will provision a new instance of Ubuntu. This might take a while.

launching-new-instance-of-wsl-ubuntu

At the same time, the WSL GUI will be displayed with menu options on the left sidebar that you can click to reveal more information about WSL.

welcome-to-wsl-gui-interface

You can launch WSL from PowerShell as an administrator as follows:

Command Line
wsl.exe  -d ubuntu

The initial launch will require you to supply a UNIX user and password. Once you’ve keyed in the credentials, you will be ushered into the latest Ubuntu release CLI environment.

launch-ubuntu-wsl-using-windows-powershell

To exit from the shell environment, run:

Command Line
exit

For subsequent WSL launches, search for Ubuntu using the Windows Search bar and click the first option labelled Ubuntu App.

launch-ubuntu-wsl-using-windows-search-gui

This opens a terminal shell that provides a Linux environment.

ubuntu-wsl-terminal-cli-interface

NOTE

As earlier stated, WSL installs and runs Ubuntu by default. You can install a different distribution using the syntax:

Command Line
wsl --install -d <distribution>

For example, to install WSL with Debian as the default OS, run:

Command Line
wsl --install -d Debian

Additionally, you can install a specific release by specifying its version. For example, to install Ubuntu 24.04, run:

Command Line
wsl --install -d Ubuntu-24.04

To list all supported Linux distros using the command:

Command Line
wsl --list --online

list-operating-systems-supported-by-wsl

To check the version of WSL, run:

Command Line
wsl --version

#Pros

  • Free. No costs are required to run it.

  • Easy and quick to install and set up. Only requires a few steps.

  • Supports multiple Linux distros.

  • Lightweight and moderate resource usage.

  • Great for running simple tasks, e.g, Bash scripting, programming, and running CLI tools.

  • Great Windows integration. You can access Windows files from Linux within WSL.

  • Great support for GUI Linux apps.

#Limitations

  • Limited hardware access. WSL lacks out-of-the-box support for hardware such as USB devices and webcams. You need additional applications like USBIPD to share connected USB devices with your virtual instance.

  • Increased power consumption since WSL runs a lightweight Linux VM.

  • Distributions like AlmaLinux and Fedora can consume significant hard disk space when the VHD becomes too large.

  • While WSL 1 can use the LAN IP configuration, WSL 2 uses NAT by default. Additional configuration is required if you intend your instance to be a part of your LAN subnet.

  • Slower than conventional Linux distros, particularly when running heavy workloads.

#Run Linux commands using Git Bash application

Git Bash is another nifty application for running Linux commands on a Windows system. It provides a means to interact with Git, a version control system, thereby narrowing the divide between the Unix-centric nature of Git and Windows.

In addition to offering a Swiss Army knife of Git commands for version control, Git Bash also provides a Bash shell for running Linux commands. It doesn't provide an emulation layer, unlike WSL or a VM. Instead, it runs on MSYS2, a minimal POSIX compatibility layer that allows UNIX tools and utilities to run on top of Windows.

To install Git Bash, visit the Git Bash download page and grab the .exe installation file. Run the installer and select the default options for a seamless CLI experience. Launch it by searching for it from the search bar.

launch-git-bash

This is how the interface looks.

git-bash-terminal-cli-interface

#Pros

  • Quick and easy to install. Takes just a minute or two.

  • Fast and lightweight with low resource usage.

  • Open-source and free to use.

  • Provides the whole Git CLI suite for running all version control tasks.

  • Supports SCP and SSH protocols for establishing secure remote connections.

  • Runs directly on Windows; hence, no virtualization or added configuration is required.

  • Allows you to run Linux/UNIX basic commands like touch, mkdir, rmdir, pwd, ls, cat, date, grep, and many more. Hence, an excellent tool for learners and CLI enthusiasts.

  • A portable option that runs from a USB pendrive is available. In this case, no installation is needed.

#Limitations

  • Some Linux command tools, such as package managers (dnf, apt, yum), system utilities (top, htop, and lsof), and the GCC compiler, are missing.

  • Uses Windows paths for navigation. To navigate, you must specify a backslash '' instead of a forward slash '/', native to Linux.

  • Slower than native Git when handling huge repositories.

  • Lack of full GUI support. Unlike WSL, you cannot run desktop apps.

  • Some tools, such as ping, exhibit different behavior when used on a native Linux environment.

  • It is less ideal for complex development environments such as bash scripting or full software stacks since some Linux tools are either missing or run differently. WSL is a more appropriate option.

#Run Linux commands using the Cygwin application

Unlike WSL, Cygwin does not offer a Linux kernel. It's a translation layer that provides a vast assortment of compiled GNU/Linux tools. There's a catch, though - the default installation does not offer you all the tools. You get only a minimal set of Bash tools like pwd, ls, mkdir, rmdir, gzip, and core libraries. Thankfully, the installer offers the flexibility to choose from advanced tools like GCC, Make, Python3, pkg-config, CMake, & development libraries.

It's a popular tool for developers owing to its excellent support for programming languages, including PHP, Java, Python, and JavaScript.

Here's a comprehensive list of all the packages offered by Cygwin

To install Cygwin, visit the Installation Page, download, and run the executable file.

cygwin-terminal-cli-interface

#Pros

  • Free and open-source. No costs are needed to use it.

  • Runs natively on Windows; hence, no need for virtualization.

  • Offers a wide range of GNU/Linux utilities and libraries during installation. You can select to install all or some of the packages.

  • Offers a POSIX compatibility layer, enabling Unix-based applications to run seamlessly on Windows.

  • Highly customizable. It lets you choose which tools you prefer to include during installation.

  • An active online community with plenty of documentation.

  • Good for porting Linux apps.

#Limitations

  • Resource overhead can sometimes cause slower performance compared to WSL or a native Linux environment.

  • Choosing to install all packages during installation takes a long time and often requires significant disk space.

  • Lacks native Linux package managers such as apt, dnf, and pacman.

  • Not a full replacement for a Linux environment. It's just a POSIX emulation layer, and some Linux-centric commands don't work.

  • Limited Windows integration.

#Run Linux commands using a Virtual Machine

Lastly, you can create a virtual machine and run Linux on top of your Windows PC. In this method, a hypervisor is first installed on Windows. It creates a virtualization layer that sits on top of your physical PC and allows resource sharing across virtual machines. Once installed, a user can create virtual machines depending on the resource capacity of the underlying hardware.

The hypervisor layer lies between the underlying hardware and the virtual machines, abstracting hardware resources such as memory, CPU, and disk space and supplying them to the virtual machines. Virtual machines share the underlying hardware resources but run independently. You can create a virtual machine from an ISO file from your preferred Linux distribution or a prebuilt hard disk image file.

Hypervisors are broadly categorized into two.

Type 1 hypervisors are installed directly on bare-metal computers, while Type 2 hypervisors are deployed on top of an already-installed operating system. In this context, you can leverage a Type 2 hypervisor such as Oracle VirtualBox or VMware Workstation on your Windows PC and provision virtual machines.

virtual-machine-running-on-windows-10

#Pros

  • You get a complete Linux environment with all the tools and utilities. The Linux VM runs just like a native Linux OS on bare metal.

  • You can create multiple virtual machines and run them concurrently, provided you have ample hardware resources.

  • Supports both GUI and CLI. You can run a desktop GUI seamlessly, just as you would a minimal or headless server.

  • Supports nearly all Linux OS distributions. You can run virtual instances of popular distributions like Ubuntu, Debian, Fedora, Rocky, and AlmaLinux, and other less popular ones like Slax, Puppy Linux, Crunchbang++, and Solus.

  • Ideal for learning purposes. You can practice running commands and experiment with various apps without impacting the underlying Windows environment.

  • Flexibility in network configuration. You can configure NAT, bridged, or host-only networking for virtual machines, unlike other options, which support NAT only.

  • Customizable resources. You can easily scale up or down resources such as CPU cores and RAM as needed.

#Limitations

  • Virtualization overhead. Virtual machines share the same resources with the host (Windows OS), which leads to resource exhaustion.

  • Virtualization can degrade the performance of the host OS if resources are over-provisioned or multiple VMs are running concurrently. As a recommendation, ensure you have ample resources to accommodate the VM and leave enough for the host system to run smoothly.

  • High power usage in laptops.

  • Longer boot times compared to WSL and Git Bash.

  • Virtual hard drives can grow exponentially and quickly use up disk space, leading to storage constraints in the underlying Windows OS.

  • USB and peripheral device limitations. Not all USB devices will work with the VMs seamlessly. Additional configuration may be required.

  • Longer Boot Times—Takes more time to start compared to WSL or Git Bash.

Windows Dedicated Servers for Enterprise Workloads

Deploy dedicated Windows servers with flexible hardware options, licensed software, full administrative access, and 24/7 expert support for reliable enterprise workloads.

#Conclusion

We have explored various ways of running Linux commands on Windows. WSL, Git Bash, and Cygwin are fundamentally lightweight and quick to install. However, they lack some essential Linux/UNIX tools and utilities. Meanwhile, a virtual machine offers a complete Linux experience for both GUI and CLI instances but requires more resources from the underlying hardware to run.

For old or low-spec hardware, WSL, Git Bash, and Cygwin will be more preferable. For modern and high-spec hardware, a virtual machine is the best contender to enjoy a full Linux experience. You can take advantage of Cherry Servers' cloud virtual servers that go for as little as $3.24 per month. These are general-purpose VPS servers tailored for small to average workloads. They are fast and easily scalable on the go.

Cloud VPS Hosting

Starting at just $3.24 / month, get virtual servers with top-tier performance.

Share this article

Related Articles

Published on Nov 14, 2025 Updated on Nov 14, 2025

8 Best Linux Distros for Server Hosting

Discover the best Linux distros for server hosting with pros, cons, and use cases to help you choose the right, stable, secure OS for your cloud or bare-metal servers.

Read More
Published on Nov 6, 2025 Updated on Nov 7, 2025

How to Install WordPress on Ubuntu 24.04: Step-by-Step Guide

Install WordPress on Ubuntu 24.04 easily. Learn step-by-step setup using Nginx, PHP, and MariaDB for a fast, secure site hosted on Cherry Servers.

Read More
Published on Oct 29, 2025 Updated on Nov 7, 2025

How to Install Xrdp on Ubuntu 24.04: Step-by-Step Tutorial

Learn how to install and set up Xrdp on Ubuntu 24.04 to access your server via a graphical desktop remotely using RDP clients like Windows Remote Desktop."

Read More
We use cookies to ensure seamless user experience for our website. Required cookies - technical, functional and analytical - are set automatically. Please accept the use of targeted cookies to ensure the best marketing experience for your user journey. You may revoke your consent at any time through our Cookie Policy.
build: eeb2b4d43.1524