Windows Subsystem for Linux WSL2 Commands

Опубликовано: 02 Октябрь 2024
на канале: Liv4IT
320
11

Windows Subsystem for Linux WSL2 Commands

The ability to run Linux natively in Windows 10 is provided by the WSL feature. WSL stands for Windows Subsystem for Linux, which initially, was limited to Ubuntu only. Modern versions of WSL allow installing and running multiple Linux distros from Microsoft Store.

After enabling WSL, you can install various Linux versions from the Store:
Ubuntu
openSUSE Leap
SUSE Linux Enterprise Server
Kali Linux for WSL
Debian GNU/Linux
and more.

Windows 10 offers two methods to start a WSL distro. For distros installed from the Store, you can use either the console wsl.exe tool, or a Start menu shortcut.

WSL Coomads:
To list installed distributions
wsl -l
wsl --list

To list installed distributions along with its running status and wsl config being 1 or 2
wsl -l --verbose
wsl -l -v

To run a specific distro
wsl -d distro_name
wsl --distribution distro_name

To terminate/shutdown a specific distro
wsl -t distro_name_to_shutdown
wsl --terminate distro_name_to_shutdown

To shutdown all disstros
wsl --shutdown

To EXPORT a running distro as image
wsl --export distro_name_to_export windows_path\tar_file_name.tar

To IMPORT an image as distro
wsl --import new_distro_name install_location_windows_path tar_file_name.tar --version wsl-version-1-or-2
wsl --import Ubuntu-20 D:\VMs\WSL\Ubuntu-20\ Ubuntu-20.04.tar --version 2 # Setting my secondary HDD as storate loc for new distro










🌸 Support channel & make donation :
https://www.paypal.me/aminenina/10

🌸 Subscribe for more videos :
Youtube:    / aminosninatos  

🌸 Follow me On Social Media
Facebook :   / aminosninatos  

***********************************************************************

🌸 How To Check Bad Blocks Or Bad Sectors On a Hard Disk In Linux
https://www.youtube.com/watch?v=jE-I9...

🌸 Linux How To Partition a Hard Drive Using the Parted Command
https://www.youtube.com/watch?v=2IoEW...

🌸 Checking or Repairing a File System using fsck in Linux
https://www.youtube.com/watch?v=CcV_M...

🌸 How To Monitor the Health of Your Hard Drive in Linux using SMART
https://www.youtube.com/watch?v=z1z9R...

🌸 Linux iotop: Monitor your disk Input/Output
https://www.youtube.com/watch?v=pWG4v...

🌸 How To use the “du” (Disk Usage) Command in Linux
https://www.youtube.com/watch?v=RA4bM...

🌸 How To View Manipulate System Logs In Linux Using Journalctl Command
   • How To View Manipulate System Logs In...  

🌸 How To Sync And Backup Files In Linux Using Rsync Command
   • How To Sync And Backup Files In Linux...  

🌸 Linux cURL Command Tips and Tricks
   • Linux cURL Command Tips and Tricks  

🌸 Linux tail and multitail commands
   • Linux tail and multitail commands  

🌸 Linux How To view Log Files
   • Linux How To view Log Files  

🌸 How To use the History Command On Linux
   • How To use the History Command On Linux  

🌸 Tips and Tricks How To manipulate Text Files on Linux
   • Tips and Tricks How To manipulate Tex...  

🌸 How to Archive, Compress and Extract Files Using the tar Command on Linux
   • How to Archive, Compress and Extract ...  

🌸 Linux - How to split larger files into smaller parts
   • Linux - How to split larger files int...  

🌸 Linux commands : Top
   • Linux commands : Top  

***********************************************************************

#wsl #linux #windowssubsystem