How To Learn Linux On Windows 11

People are currently reading this guide.

Alright, let's embark on an exciting journey to explore the world of Linux, right here on your Windows 11 machine! Have you ever been curious about that powerful, open-source operating system that powers so much of the internet and the tech world? Well, get ready to dive in!

Step 1: Choosing Your Adventure - Picking a Linux Distribution

Before we even touch any settings, let's talk about the different flavors of Linux, often called distributions or "distros." Think of them like different versions of Windows, each with its own personality and set of pre-installed tools. Don't worry, you won't be installing a whole new operating system just yet! We'll be using tools within Windows 11 to experience Linux.

  • Popular Choices: Here are a few beginner-friendly distributions that work wonderfully within Windows:

    • Ubuntu: Often recommended for beginners, Ubuntu has a large community and tons of online support. It's known for its ease of use.
    • Debian: A very stable and reliable distribution, forming the basis for Ubuntu. It's a great choice if you value stability above all else.
    • Fedora: A cutting-edge distribution sponsored by Red Hat. It's excellent for developers who want to work with the latest software.
  • No Need to Choose Right Now: For our initial steps, the specific distribution you choose within Windows won't drastically change the learning experience. However, it's good to be aware of these different options.

Step 2: Setting Up Your Linux Playground - Installing WSL

Windows Subsystem for Linux (WSL) is the magic tool that allows you to run a Linux environment directly on your Windows 11 system without the need for a virtual machine or dual-booting. Let's get it installed!

  • Step 2.1: Enabling the WSL Feature:

    1. Click on the Start Menu (the Windows icon on your taskbar).
    2. Type "Turn Windows features on or off" and click on the result.
    3. Scroll down the list until you find "Windows Subsystem for Linux".
    4. Check the box next to it.
    5. You might also want to check "Virtual Machine Platform" as WSL 2 (the newer and recommended version) relies on it.
    6. Click OK. Windows might ask you to restart your computer – go ahead and do so.
  • Step 2.2: Installing Your Chosen Distribution:

    1. Open the Microsoft Store (search for it in the Start Menu).
    2. In the search bar, type the name of the Linux distribution you're interested in (e.g., "Ubuntu," "Debian," "Fedora").
    3. Click on the distribution you want to install.
    4. Click the "Get" or "Install" button.
    5. Once the download is complete, click "Open".
  • Step 2.3: Initial Setup:

    1. A console window will appear. This is your Linux terminal!
    2. You'll be prompted to create a username for your Linux environment. Choose something you'll remember.
    3. Next, you'll be asked to create a password for this user. Type it carefully – you won't see the characters as you type (this is a security feature in Linux). Press Enter.
    4. You'll be asked to confirm your password. Type it again and press Enter.
    5. Once this is done, you'll have a fully functional Linux environment running inside Windows!

Step 3: Getting Your Feet Wet - Basic Linux Commands

Now that you have your Linux terminal open, it's time to start learning some fundamental commands. Don't be intimidated; think of it as learning a new language!

  • Step 3.1: Navigating the File System:

    • pwd: Stands for "print working directory." This command shows you where you are currently located in the Linux file system. Try typing it and pressing Enter.
    • ls: Stands for "list." This command displays the files and directories in your current location. Try ls and then ls -l (for a more detailed listing).
    • cd: Stands for "change directory." This command allows you to move between directories. For example, cd .. moves you up one directory, and cd <directory_name> moves you into a specific directory. Try navigating around!
  • Step 3.2: Working with Files and Directories:

    • mkdir <directory_name>: "Make directory." Creates a new directory with the name you specify.
    • touch <filename>: Creates an empty file with the name you specify.
    • rm <filename>: "Remove" a file. Be careful with this command!
    • rm -r <directory_name>: "Remove recursively" a directory and its contents. Use with extreme caution!
    • cp <source> <destination>: "Copy" a file or directory.
    • mv <source> <destination>: "Move" or "rename" a file or directory.
  • Step 3.3: Getting Help:

    • man <command>: "Manual." This command displays the manual page for a specific command, providing detailed information about its usage and options. For example, man ls will show you all the options available for the ls command. Press q to exit the manual page.
    • <command> --help: Many commands also have a --help option that provides a brief summary of their usage.

Step 4: Expanding Your Horizons - Package Management

One of the powerful aspects of Linux is its package management system, which makes installing, updating, and removing software incredibly easy. The commands vary slightly depending on your chosen distribution.

  • Step 4.1: For Ubuntu and Debian:

    • sudo apt update: Updates the list of available packages. You'll often need to run this before installing new software. sudo allows you to run commands with administrator privileges (you'll be asked for your password).
    • sudo apt upgrade: Upgrades the installed packages to their latest versions.
    • sudo apt install <package_name>: Installs a new package. For example, sudo apt install nano will install the nano text editor.
    • sudo apt remove <package_name>: Removes a package but leaves its configuration files.
    • sudo apt purge <package_name>: Removes a package and its configuration files.
  • Step 4.2: For Fedora:

    • sudo dnf update: Updates the list of available packages and upgrades installed packages.
    • sudo dnf install <package_name>: Installs a new package.
    • sudo dnf remove <package_name>: Removes a package.

Step 5: Leveling Up - Exploring More Advanced Concepts

As you become more comfortable with the basics, you can start exploring more advanced Linux concepts:

  • Shell Scripting: Automate tasks by writing scripts in the Bash shell (the default shell in most Linux distributions).
  • Permissions: Understand how Linux manages file and directory permissions to control who can read, write, and execute files.
  • Networking: Learn basic networking commands like ip addr, ping, and netstat.
  • System Administration: Explore how to manage users, groups, and services.
  • Text Editors: Master a command-line text editor like nano, vim, or emacs.
  • Piping and Redirection: Learn how to combine commands using pipes (|) and redirect input/output using > and <.

Step 6: Staying Curious - Continuous Learning

The world of Linux is vast and ever-evolving. The key to learning is to stay curious and keep practicing.

  • Explore Online Resources: There are countless websites, tutorials, and forums dedicated to Linux.
  • Try Different Distributions: Once you're comfortable, you can experiment with other distributions within WSL.
  • Work on Projects: The best way to learn is by doing. Try setting up a simple web server, automating a task, or exploring a specific area of interest.
  • Engage with the Community: Join online forums or communities to ask questions and learn from others.

Remember, learning takes time and effort. Don't be discouraged if you encounter challenges. Embrace the process, and you'll gradually become more proficient in using Linux on your Windows 11 machine.


How to... Frequently Asked Questions

How to open the Linux terminal in Windows 11 after installing WSL?

You can open your installed Linux distribution by searching for its name (e.g., "Ubuntu") in the Start Menu and clicking on the application. This will open a new terminal window.

How to access Windows files from the Linux terminal?

WSL typically mounts your Windows drives under the /mnt directory. Your C drive will usually be accessible at /mnt/c/. You can navigate through your Windows file system using the cd command within this directory.

How to run graphical Linux applications on Windows 11?

For WSL 1, this was more complex. However, WSL 2 offers better support for graphical Linux applications through WSLg (Windows Subsystem for Linux GUI). Ensure you have the latest version of WSL, and then you should be able to run some graphical applications directly.

How to update my installed Linux distribution?

For Ubuntu/Debian, use sudo apt update followed by sudo apt upgrade. For Fedora, use sudo dnf update.

How to install new software in my Linux environment?

For Ubuntu/Debian, use sudo apt install <package_name>. For Fedora, use sudo dnf install <package_name>.

How to uninstall software in my Linux environment?

For Ubuntu/Debian, use sudo apt remove <package_name> or sudo apt purge <package_name>. For Fedora, use sudo dnf remove <package_name>.

How to find out which Linux distribution I have installed?

Open your Linux terminal and type lsb_release -a and press Enter. This command will display information about your distribution.

How to set a default Linux user in WSL?

You can set a default user by using the command ubuntu config --default-user <username> in PowerShell (replace ubuntu with your distribution name and <username> with your desired username).

How to uninstall a Linux distribution from WSL?

Open PowerShell as an administrator and use the command wsl --unregister <DistributionName> (replace <DistributionName> with the name of your distribution as listed by wsl --list).

How to learn more advanced Linux commands and concepts?

Explore online resources like the Linux Documentation Project, read tutorials on websites like Linux.com or TecMint, and consider following online courses on platforms like Coursera or Udemy. Practice regularly and don't be afraid to experiment!

9117240805132031309

You have our undying gratitude for your visit!