Linux enthusiasts have been singing praises about the flexibility and power of the Linux command line for years. As a person who has worked with both Windows and Linux environments, I can attest to the strengths of each system. I remember the days when switching between these two operating systems was a laborious process that required a machine reboot.
However, with the latest advancements in Windows 10 and Windows 11, Microsoft has made it possible for users to run Linux commands directly on their Windows machine, eliminating the need for a dual-boot setup or a virtual machine. In this blog post, I will provide you with a step-by-step guide on how to enable and use the Linux subsystem on Windows, and demonstrate how it can boost your productivity and make your life easier. Trust me, it’s an exciting development that you don’t want to miss out on!
Running Linux Commands on Windows 10/11
1. Embrace the Windows Subsystem for Linux (WSL)
The key to running Linux commands on Windows is the Windows Subsystem for Linux (WSL). Initially, I was skeptical. I mean, Linux on Windows? It sounded too good to be true.
What is the Windows Subsystem for Linux?
Simply put, WSL allows you to run a Linux distribution alongside your existing Windows installation. It’s not a virtual machine, nor is it dual-booting. Instead, it integrates Linux and Windows seamlessly, making them feel like one cohesive system.
Setting up WSL on your Windows Machine
- Enable the Windows Subsystem for Linux feature: Open Control Panel, click Programs and Features, go to the Windows Features on or off section, and check the box next to “Windows Subsystem for Linux.” Restart your computer if prompted. Remember the times when system restarts annoyed me? Here’s one instance, but I promise it’s worth it.
- Install your preferred Linux distribution: Open the Microsoft Store and search for your favorite Linux distribution. My personal favorite is Ubuntu, mainly because of its widespread community support. Once found, click “Get.”
- Initialize your Linux distribution: After installation, launch your Linux distribution from the Start menu. A console window will open, and you’ll be prompted to create a user and set a password. This will be your Linux user, separate from your Windows user.
And voila! You can now run Linux commands right from your Windows machine.
2. Getting to know Windows Terminal
While the default console is functional, I highly recommend Windows Terminal. It’s a modern, fast, efficient, and powerful terminal application for users of command-line tools and shells.
Why I recommend Windows Terminal
The first time I fired up Windows Terminal, I was taken by its aesthetic appeal. It supports multiple tabs, rich text, theming, and nice appearance settings. Plus, you can have both your Windows Command Prompt and Linux shells in the same window, in different tabs. It’s simply a treat for the eyes!
Installing Windows Terminal
Just head over to the Microsoft Store, search for “Windows Terminal,” and click “Install.” If it’s already installed on your system, click on “Open”. The simplicity and efficiency of this process always make me smile.
3. Diving into Linux commands
With WSL set up and Windows Terminal ready, it’s time to get your hands dirty with some Linux commands.
Basic commands to start with
- ls: Lists files in the current directory. I use it almost reflexively every time I change directories.
- pwd: Shows the path of the current directory. Perfect for when you get lost in the maze of folders.
- cd: Change directories. The bread and butter of navigation.
- echo: Display a message or output. A simple command, but has its moments of glory.
- man: Displays the manual page for any command. It’s like the Google for Linux commands. Whenever I forget how to use a command, ‘man’ is my savior.
When you first encounter Linux commands, the sheer number of them can be overwhelming and leave you feeling unsure of where to start. However, what makes these commands truly remarkable is their vast array of capabilities and adaptability. With continued practice and exploration, you’ll discover the beauty of the Linux command line and how it can be used to accomplish tasks in a way that is both efficient and elegant. So, don’t be discouraged by the initial complexity of Linux commands. Instead, embrace the boundless potential they offer and enjoy the journey of mastering them. Here are more beginner-friendly Linux commands for your reference.
4. Combining Linux and Windows workflows
One of the things I adore about WSL is the ability to combine Windows and Linux workflows. You can execute Windows binaries directly from the Linux command line and vice versa.
For instance, if I’m in the Linux environment and want to open a file with a Windows application, I can do that effortlessly. Such flexibility was unimaginable a few years back!
5. Issues you might face (and how to tackle them)
As much as I love WSL, it’s not without its quirks.
File system woes: One thing to note is the difference between the Linux and Windows file systems. For best performance, always store your Linux projects in the Linux file system (not in the Windows file system). Accessing Windows files from Linux is fine for occasional tasks, but it can be slow for more intensive operations.
Software compatibility: Note that WSL isn’t a full-fledged Linux kernel (yet). So, some software that requires specific kernel features might not work. Always check compatibility before diving deep.
Conclusion
Are you tired of constantly switching between Windows and Linux operating systems? Running Linux commands on Windows 10/11 can be a game-changer for you. With this powerful functionality, you can combine the best of both worlds and experience a flexible and dynamic environment for developers and enthusiasts. If you’re looking to explore and embrace this innovative feature, I highly recommend it. Remember, every tool has its learning curve, so don’t be discouraged by initial hiccups. Take the plunge, and soon enough, you’ll be utilizing the power of Linux commands on your Windows machine like a pro. It’s time to elevate your coding game. Happy coding!
2 comments
What the hell is this? Posting articles about Windows is neither about anything related to FOSS nor about Linux. Goodbye, you’ve lost a reader.
Nice write up for newbies in Tech/IT community, so educating and interesting to know.
God bless you