Windows Subsystem for Linux (WSL)
Content
Introduction
System requirements
Install WSL
Basic command in ubuntu
Introduction
The Windows Subsystem for Linux (WSL) allows you to run a Linux environment directly on
your Windows machine, without the need for a separate virtual machine or dual booting. Here
are some key reasons to use WSL:
1. Access Linux tools and frameworks like Bash, sed, awk, Ruby, Python, etc. while still
using Windows productivity tools.
2. Access your local Windows file system from within the Linux Bash shell, with drives
mounted under the /mnt folder.
WSL provides the best of both worlds - the ability to use Linux tools and frameworks while still
benefiting from the Windows operating system and development environment. It's a powerful
tool for developers working with Linux-first technologies and open source projects.
System requirements
● Windows 11 - professional with recent update
Install WSL
To install Ubuntu 22.04 on Windows Subsystem for Linux (WSL), follow these steps:
At first, use the following command to list all the available Linux distros:
Open windows cmd in run as administrator mode.
>>wsl --list --online
>>wsl --install -d Ubuntu-22.04
Give a username for Ubuntu. Finally, set a password.
>> sudo apt update
>> sudo apt upgrade
Basic command in ubuntu
● ls - display files in current directory.
● pwd - display current working directory.
● mkdir test - create a directory named ‘ test’.
● cd test - move inside test folder.
● rmdir test - remove directory test
● wget http://example.com/sample.php - download a file from URL.
● clear - clear terminal
● touch name.txt - create a file name.txt
● cat name.txt - load name.txt in terminal
● mv name.txt name1.txt - rename file as name1.
● rm name1.txt - remove file name1.txt
● sudo usermod -aG sudo user - To grand sudo access to user